My Community Dashboard

  • Howto - Virtualbox Headless on ClearOS

    Because ClearOS has such a small footprint it actually makes quite a good VM server for various guest OS's.

    There are threads on VMWare in the forum, and how to get that setup - so i'd thought i'd have a go with VirtualBox which also has a headerless function which can be viewed using standard Windows Remote Desktop. This makes it great for running remote OS's

    The latest version of VirtualBox is 3.1.2 however this version made some config changes from 3.0.x to the way in which storage controllers and resources are called up (long story short to enable more than one DVD drive etc)...I had more success with the tried and tested 3.0.12 method so this Howto is based around that version. Hopefully in future we'll be able to update this with the newer version. Be careful when googling for info as the syntax changed between versions.

    INSTALLATION
    First up you will need the devel tools to enable the kernel modules to be compiled during install. If you are running the PAE kernel, replace with kernel-PAE-devel


    Download the RPM for RHEL5 i386


    Installation will create a group called vboxusers, we need to add a user to this group, or create a seperate vbox specific user. I went for the latter as I wanted to keep it separate from my other accounts. User is named 'vbox' for example, we also then add the user to the vboxusers group



    VirtualBox is not LDAP aware so these need to be system user / accounts, hence the -r flag for useradd. It should create a user with an SID < 500 so that it is not removed by the system at a later date.

    This should confirm that you user has been created and associated with the group
    cat /etc/passwd | grep vbox
    cat /etc/group | grep vbox

    CREATE AND CONFIGURE A VM
    Now on to the fun bit...! Creating a VM ( I won't touch on importing your own *.vdi or *.ovf appliances here, have a read of the VirtualBox manual over here for clues http://www.virtualbox.org/manual/UserManual.html

    First switch to the new user, then we will start to create the VM. Note using the GUI is so much easier but we don't want the overheads of the full X system so stick with it :) it will start to make some sense

    Again NOTE sysntax has changed for the new 3.1.2 version, this applies to 3.0.12

    Outline steps are:- switch to vbox user (all configuration is by default stored in /home/vbox/.VirtualBox/ subfolders
    Create the VM name and register it, remember this or write it down, I called mine Windows XP


    This should return without error. The VM will be created under /home/vbox/.VirtualBox/Machines/...you can of course symlink this to another directory on the system if you wish

    Now to setup some basic parameters for the VM. We are using 512MB, boot DVD first, use basic bridged connection with the LAN interface to give it internet access. You can also specifcy --nic2 etc...or --nic1 nat. See VBoxManage man page for full config details


    Now to create the VM HD, set to 10GB, and stored under /home/vbox/.VirtualBox/HardDisks/. We then assign this HD to our VM as the primary HD device hda


    Next step to register our installation ISO with VirtualBox (this is akin to the media manager if you've used the GUI before). We then register this as the DVD drive associated with our VM. The ISO can live anywhere on your system as long as vbox can read it.


    START YOUR VM
    Thats it! a basic config that should now get a VM install running. To start our VM headerless we now run the following, and then connect remotely using Windows Remote Desktop to ClearOS (port 3389 is used by default). Note the & at the end, this will force it to run in the background, so you should ensure you shutdown the VM correctly or use VBoxManage to control / save the states on exit)


    To detach the DVD iso (i.e. eject it) use the following

    You may also try - if the VM is running


    GUEST ADDITIONS
    Now I found that the display and mouse did not correlate very well until I install the guest additions. So....register and attach the guest additons ISO, then boot your VM and run the installer from within the OS


    Enjoy! :)
    For more configuration options refer to http://www.virtualbox.org/manual/UserManual.html#vboxmanage-modifyvm Particularly for increasing the video card memory size, NIC options etc.

    TIPS - To be completed....
    Want to see a VM config? use VBoxManage showvminfo "WindowsXP"
    Want to see HD config? use VBoxManage showhdinfo harddiskname.vdi
    Want to change Video RAM allocated to VM? use VBoxManage modifyvm "WindowsXP" --vram 128MB
    Want to enable USB and USB2.0? use VBoxManage modifyvm "WindowsXP" --usb on --usbehci on
    Want to shutdown a VM? use VBoxManage controlvm "WindowsXP" acpipowerbutton (for instant off, use poweroff)
    Need to press CTRL-ALT-DEL to login over RDP? it's locked solely to the local machine, so use CTRL-ALT-END instead ;)
    Want to see other ostypes? use VBoxManage list ostypes