Intel NUC virtualization setup

I picked up the Intel NUC yesterday and have been configuring it for virtualization. I think I’ve got it, and before I forget what I’ve learned I will jot everything down. Just as I mentioned in yesterday’s post the first step is to configure the box with a static IP address (I’ll be using 192.168.0.5). Let the fun begin!

Installing Virtualbox on Ubuntu 18.04 Server

I found an excellent tutorial here on how to install Virtualbox on ubuntu 18.04. I will summarize the steps taken here:

Update Ubuntu server
– sudo apt update
– sudo apt upgrade

Install the necessary packages for the installation process
– sudo apt install build-essential dkms unzip wget
– sudo reboot

Add Virtualbox repository to your sources file
– sudo vi /etc/apt/sources.list
Then add the following to the end of the file:
deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib
– sudo apt update

Add the Oracle public key
– wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add –

Install VirtualBox
– sudo apt install virtualbox-5.2

Add user (your login) to the vboxusers group (which was automatically created during Virtualbox install)
– sudo usermod -aG vboxusers administrator

Confirm the virtualbox kernel modules are loaded
– sudo systemctl status vboxdrv
You should see the status as active (green)

Install Virtualbox extension pack
– wget https://download.virtualbox.org/virtualbox/5.2.14/Oracle_VM_VirtualBox_Extension_Pack-5.2.14.vbox-extpack
– sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.14.vbox-extpack

Install phpVirtualBox

phpVirtualBox provides a graphical user interface into the Virtualbox. It allows you to create, start, stop, configure and destroy virtual machines through a web browser.

Install necessary packages
– sudo apt install apache2 php php-mysql libapache2-mod-php php-soap php-xml
Confirm apache was sucessfully installed by visiting http://192.168.0.5. You should see the Apache2 “Default Ubuntu Page”.

Download and unzip phpVirtualBox from github
– wget https://github.com/phpvirtualbox/phpvirtualbox/archive/5.2-0.zip
– unzip 5.2-0.zip

Move the extracted folder into /var/www/html/virtualbox and change permisions
– sudo mv phpvirtualbox-5.2-0/ /var/www/html/virtualbox
– sudo chmod 777 /var/www/html/virtualbox/

Rename the phpVirtualBox config file and change the credentials
– cd /var/www/html/virtualbox
– mv config.php-example config.php
– vi config.php
Change the following:
var $username = ‘administrator’;
var $password = ‘[password of administrator]’;

Create a file (/etc/default/virtualbox) and assign your username to VBOXWEB_USER
– sudo vi /etc/default/virtualbox
Then place the following into it:
VBOXWEB_USER=administrator

Restart the system and access phpVirtualbox
– sudo reboot
In your web browser visit http://192.168.0.5/virtualbox
username: admin
password: admin

!!NOTE!! Change the default password
All went well and I was able to see the VirtualBox GUI. Next step, lets add some VMs!

Adding a VM

What’s nice about virtualization is that if I corrupt / mess up one of the VMs I create from here on out I can just recreate it. In theory the underlying OS (Ubuntu Server 18.04 should not be affected). To create the first VM navigate to the VirtualBox homepage (http://192.168.0.5/virtualbox/) and:

Create the VM
– Click “New”
– Provide a name for the VM you are creating and version (architecture).
– Allocate Memory (I’ll use 8192MB)
– Create a virtual hard disk. (I’ll create a Fixed size 200GB VHD)

Save the iso image in your filesystem
– mkdir /home/administrator/iso_images
– cd iso_images
– wget http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.1-server-amd64.iso

Start the VM and load the iso image
– Right Click on the VM in VirtualBox and select “Start”
– A popup will prompt you to select the start up disk. Select the iso image you just downloaded (/home/administrator/iso_images/ubuntu-18.04.1-server-amd64.iso)
– Once the VM starts you will see a blue port number (eg 9000). Click on it and it will download an RDP connection icon. Click on it to connect to the VM. Then follow the usual OS installation steps.
– After the installation completes you will be able to log in. Type “ifconfig” and notice that your ip address is not the standard 192.168.XXX.XXX. Lets change this.

Assigning a static ip with the format 192.168.XXX.XXX
– Power off the VM down and select “Settings” after right clicking on the VM in VirtualBox. Go to “Network” and change the “Attached to:” value to “Bridged Adapter”.
– Start the VM and run ifconfig again to notice the ip address will now start with 192.168.
– You should now be able to SSH into the VM and assign it a static IP address

Install Webmin on the VM

Webmin provides a superb GUI for Ubuntu server. It also allows for easy creation of virtual web servers. I’ve used it in the past and the UI has been updated so why not install it again?

Webmin has 3 step instructions on how to install their product. Let’s follow them:

Ensure all dependencies are fulfilled
– sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Download Webmin
– wget http://prdownloads.sourceforge.net/webadmin/webmin_1.890_all.deb

Install Webmin
– sudo dpkg –install webmin_1.890_all.deb

Webmin will now be be accessible vi http://{ip-of-v}:10000

Shut down webmin (for security reasons)
– sudo /etc/webmin/stop

Good to know

– When creating a VM (such as Windows 8.1), if you find yourself having two mouse cursors then you should install Virtualbox guest additions on the Guest (windows 8.1) VM. The file ‘VBoxGuestAdditions.iso’ will be located in /usr/share/virtualbox on the machine where virtualbox is installed. You just need to copy it from the host to the guest and execute the application file. (I also also adds “better video support” which eliminates screen resolution issues.)