So I have a multi-core server which I have installed Ubuntu server. Currently, after update, it now stands at "Ubuntu 14.04.1 LTS".
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Ubuntu server is gui-less and so if I want to run Virtualbox then I am going to be using VBoxManage to create and modify VMs and VBoxHeadless to run them. Connecting to the VM will be using some form of remote desktop protocol.
First lets create the VM.
sudo VBoxManage createvm --name "plex" --register
I am calling this plex because I want to run a plex server within this VM. Eventually. Hopefully.
Now that I have a VM construct I can now define its capabilities.
sudo VBoxManage modifyvm "plex" --memory 1024 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 br0
So in the above command I am defining a RAM of 1024 KB, The --acpi indicates that I will have ACPI and I/O APIC support on the "motherboard" which is an advanced programmable interrupt controller (see http://www.virtualbox.org/manual/ch03.html#settings-motherboard). The --boot specifies the boot order of the device and I have set this to DVD for now. The --nic indicates the type of networking available to the VM which in this case is bridged - I want to be able to see this VM from my local network. Finally I indicate which bridge adapter I am using on the Host OS using --bridgeadapter1. I originally had to setup bridged networking on the host and the /etc/network/interfaces.
Since my VM will need a harddisk lets create one now using "createhd". I will keep the drive name the same as my VM and I will start it with a size of 10 GB.
sudo VBoxBoxManage createhd --filename plex.vdi --size 10000
Next we will define a storage controller which will allow us to connect the virtual disk to the virtual machine.
sudo VBoxManage storagectl "plex" --name "IDE Controller" --add ide
And once the controller is created we can attach the drive, and other things to the VM. First lets attach the new virtual drive.
sudo VBoxManage storageattach plex -storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium plex.vdi
And next lets attach an iso image of the install media of the OS I want to install in this VM.
sudo VBoxBoxManage storageattach plex --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/someuser/isos/linuxmint-17.1-cinnamon-64bit.iso
So now we should be ready to go. We would start this VM with VBoxHeadless as:
sudo VBoxHeadless --startvm plex
This is now where the fun because because we need to connect to this VM with some remote mechanism. Future posts will cover those "travails".
In the meantime there are some useful commands to see what it is we created.
What IP is it running on?
sudo VBoxManage guestproperty get plex "/VirtualBox/GuestInfo/Net/0/V4/IP"
General information?
sudo VBoxManage showvminfo plex