Wednesday, January 13, 2016

FreeBSD 10.2-RELEASE as a virtual machine - VMware 6.0

The plan was to deploy a FreeBSD virtual machine in the ESXI 6 to play around and learn more about this operating system. My previous experience was with FreeNAS, which is based on the FreeBSD.

The minimum work to have a FreeBSD virtual machine up and running in my home lab:

  1. Download Virtual Machine Images (amd64 - ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.2-RELEASE/amd64/Latest/ - download VMDK file: FreeBSD-10.2-RELEASE-amd64.vmdk.xz) :
  2. Unpack the VMDK file and upload into a VMware datastore;
  3. Create a new virtual machine with "FreeBSD (64-bit)" as the Guest Operating System;
  4. In "Select a Disk" screen, choose "Using an existing disk" and select the VMDK file from the datastore;
  5. After completing the wizard, Power On the newly created virtual machine: 
Now that the operating system is up and running, some configuration have to be done. For example:
- Set 'root' password;
- Add new users;
- Configure network card to get IP address from DHCP;
- Enable SSH for remote administration;
- Change/increase partitions;
- Probably more items in the future.


Setting 'root' password

The initial login using 'root' user will not ask for any password to be entered.
Use the command 'passwd' to set a new password:


Adding new users

It's a good idea to add at least one additional user; using the 'root' for ordinary tasks is not recommended. 
Use the command 'adduser' and fill in all required fields.


After creating the user, it's desirable to add it to 'wheel' group:

pw group mod wheel -m admin


Configuring network card to get IP address from DHCP

Initially, when checking the network interface(s) configuration using command 'ifconfig', there will be no inet set for the network adapter (e.g. vmx0):


The hostname and the IP address can be defined in the file '/etc/rc.conf' (system configuration information) as per below:


After a reboot, the auto-assigned IP address is visible as per below:



Enabling SSH for remote administration

Again edit the file '/etc/rc.conf' to enable the sshd service:


or just run the following command:

sysrc sshd_enable=YES

Some configuration related to sshd service can be configured by editing the file '/etc/ssh/sshd_config' e.g. ability to login using root through ssh:

PermitRootLogin yes
PasswordAuthentication yes




References: 

No comments:

Post a Comment