Commercial virtualization products such as VMware are effective but costly tools that enable a company to serve up different virtual machines. One alternative to these solutions is the free VirtualBox virtualization software, which is available for Linux, Windows, and Mac. With VirtualBox, it is possible to create as many virtual images as you like and then serve them up over the network. This is a tutorial on how to do that in VirtualBox.
Host and guest defined
You need to understand what host and guest mean, or else this tutorial will be quite confusing.
- Host is the operating system that serves up the virtual machines.
- Guest is the operating system running on top of the host that is served up in a virtual environment.
Setting up a virtual machine
You can have a VirtualBox setup with almost any configuration. You could use a Windows host with Linux or Windows guests, Linux hosts with Windows or Linux guests, or Mac hosts with Linux or Windows guests.
It is required to have VirtualBox and the VirtualBox Extension Packs installed on the virtual machine server. You don't need to have the application installed on the client. If necessary, the Guest will have to be set up so remote access is allowed; the way this is done will depend on what operating system is used as the Guest. The Guest on VirtualBox will have to be configured to have the VRD Server enabled and configured. To do this, follow these steps:
- Make sure the Guest operating system is Off (not suspended).
- Select the Guest operating system to be served up remotely.
- Click Configure.
- Click the Display tab.
- Click the Remote Display tab (Figure A).
- Check Enable Server.
- Set a server port that will not conflict with a port already in use.
- Select an Authentication method.
- Enable Allow Multiple Connections if you want more than one connection at a time for this virtual machine.
- Click OK.
Click the image to enlarge.
Now that one virtual machine is ready to be served up.
Hosting the virtual machine
I'll explain how to connect to a Kubuntu virtual machine. (I'm assuming you have everything installed and up and running successfully.) The Guest should not be running on the server because it is going to be made available with the help of a command VboxManager; this command allows you to turn "on" a virtual machine so it is available remotely. The usage of the command is VBoxManage modifyvm VMNAME —vrde on (VMNAME is the name of the virtual machine to be turned on). This command will turn "off" the virtual machine: VboxManage modifyvm VMNAME —vrde off. (When using VirtualBox on Windows, you will want to change to the C:\Program Files\Oracle\VirtualBox directory before you run the commands.)
The commands are instructing VirtualBox to make available the virtual machines via the virtual rdp which, by default, is served up on port 3389. So let's assume the address of the VirtualBox server is 192.168.100.21, and let's turn on the Kubuntu virtual machine with the command VBoxManage modifyvm Kubuntu -vrdp on. The next step is to fire up the virtual machine and leave it running. Now clients can connect to that virtual Guest through the Host.
Now let's hop over to a remote machine and, using an rdp connection tool (such as Terminal Server Client), connect with the address 192.168.100.21:3389. Depending on your network speed, you should see the virtual machine begin booting up right away.
If you don't want to have the virtual machine running on the host, you would run the VboxHeadless command on the Host machine: VBoxHeadless -startvm "VMNAME" (VMNAME is the name of the virtual machine to be run). This method does not require the virtual machine or VirtualBox to be running at the time.
VirtualBox is not as robust or as flexible as the VMware vSphere system, but this setup will get DIY administrators on their way to virtualization and serving up virtual machines across their networks.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.