Topics:   Apple   -   Microsoft   -   Linux   -   Unix

VDI for the Home

I have been hearing a lot about Sun?s, oops Oracle?s virtual desktop solution, VDI and decided to give it a try. Of course being a home user on a budget these days, but yet with an enough old Sun gear to choke a horse I figured it wouldn?t be an issue. I figured I would be able to coble something together. I?m sure it?s not an issue for a typical business user to come up with one or more dual or quad core system with 8+ GB of ram so they can install Solaris 10 update 8 for this project, of course the only box at home I have that comes close to meeting the specs of a demo machine (x86 four or more cores and 8GB of ram, running Solaris 10u7 and preferably two hard disks) is my Fileserver, that is currently running OSOL /dev so I can play with ZFS dedup, there is no way to put Solaris 10 on it because I would lose access to all my data. It?s a fairly beefy box for home use a 2.4 GHz Dual core AMD Athlon with 1MB L2 per core, 6GB of ram. 4x SATA 500GB drives, a separate 1TB drive for a playground pool, and 250 GB SATA drive for rpool and a gigabit Ethernet.

Let the creative solution and rule breaking begin. I decided to put the core VDA server inside a virtual running Solaris 10 inside VirtualBox, which is not a supported configuration, and allocate it 1.5 GB of ram, which goes pretty well, I followed the directions and modified the /etc/system file in the main box, so that ZFS?s ARC wouldn?t use more than 2GB of ram. It installs fairly painlessly, the next step was to install VirtualBox which I thought I could ignore since on the raw hardware I have the latest VirtualBox version 3.1.12 installed, but of course, this isn?t good enough for VDI, as it has its own custom VirtualBox release with GPL?d extensions to the webserver interface. So I decide to bite the bullet and install there custom version using their script, well to make a long story short, after getting a OpenSolaris 3.0.8 version of the custom VirtualBox from the web and then hacking the scripts, to install the webserver extensions onto OpenSolaris and reconfiguring my currently running apache to deal with VirtualBox webserver interface. The next headache appeared, I had upgraded my OSOL box to use Comstar for iSCSI, which is incompatible with VDI, and currently there is no complaint by iSCSI when you try to use it to manage iSCSI targets even though Comstar is running and has no intentions of serving those targets. So I had to remove Comstar which requires booting to another boot environment, and removing Comstar and then rebooting to the current boot environment. Of course I will have to reverse this change because I hear Comstar will be supported in a future release as normal iSCSI is going away. The next step was to start importing a Desktop to use as a template; you basically just install the desktop of your choice in a Virtual, and then install VirtualBox guest tools, and any other software you can?t live without, Firefox, and the extensions, etc then shutdown the Virtual. Go into the VDI web interface and import it as a desktop, which on my machine took about an hour.

While the import is going on it?s a perfect time to deal with a Directory Service. Here is a good short tutorial how to automate the process of installing OpenDS. It?s all very smooth, and only requires you to enter one password, unlike other directory servers I have tried. Once you install it, go into control-panel app, that it starts for you at the end of the process and Directory Data, and then Manage Entries, Domain, People and edit a couple of the entries it created for you and set to your usernames and set a new password. By the way not sure I did something weird, but my copy of OpenDS ended up getting installed at /OpenDS so the path to the control-panel app is /OpenDS/bin/ which made it difficult to find the next day as it was in the last place a good sys-admin would look for it.

Now you can go back into VDI web application and set your LDAP server, the anonymous settings is good enough for OpenDS, here is a major tip on how to make it work, this is the entry you need to use for it to find your entries, its ou= not the example. This had me banging my head against the wall. It all appears to look like all of VDI should work but, the remote desktop program (uttsc) that comes with it fails to work, rdesktop works, windows remote desktop works, but not Sun?s.

Important Tip: for OpenDS users here is main important line to the LDAP configuration

ou=People,dc=yourdomain,dc=com



You can go to the users section of the VDI web interface and search for your user name that you modified while configuring OpenDS.

After the desktop import is complete, you can convert it to a template. Then clone the template as a desktop, this is where you can see the magic of ZFS in action, the cloning takes less than 15seconds on my box to deploy a working XP instance isn?t bad in my book.


I have VDI working for the most part, the next issue, VDI monitors the VirtualBox systems ram by looking at available ram, now Solaris applications regularly access disk and the data is cached, so this available memory number is really low, usually 200MB or so. And VDI refuses to start a new virtual on the machine because available ram is too low. The Solution to this is to use VirtualBox GUI to start up a virtual allocate it to allocate 2GB of ram or so, which forces the OS to move data to swap and flush the cache, then exit the Virtual which is mlocked (locked into physical memory) and then power-off the virtual, then VDI is happy and will start up virtuals. The long term solution is to write a small C program that mlock?s gigabyte of memory, and then exits and put it in a cron job.

Well it turns out the memory availability issue was too painful, so I decided to move the core VDA server out of a virtual and to raw hardware, as the guides recommend 2GB of ram, I chose my Blade 1000, for this task it has 2x 750mhz CPU?s and 4GB of ram and 2x 146GB FCAL hard drives in a mirrored zpool, I also took advantage of the dual gigabit NIC card on board. This gave me a bit more room for memory usage on the OpenSolaris fileserver, but it seems to be a losing battle until I write the C program I mentioned above to free memory for Virtuals. I also moved the storage for the virtual hosts to my Blade 1000, as it has plenty of fast storage for the task, note: iSCSI needs a gigabit network, the synchronous method used for iSCSI pretty much demands it at least for application, I tried with the on board 100mbit NIC and it limited through put to 4MB/s far below 100mbit?s maximum of 12.5MB/s, with the gigabit NIC the through put jumped to 6MB/s because of the lower latency, which gave me about a 12% drop in performance over local storage. The situation is a bit better now, but I?m going to write the program to keep memory free. But all in all VDI is really nice software, and I have only started to scratch the service as to what it can do. I am still looking at what else I could do to improve performance using existing machines that are currently powered on.

Related Links:


  • Pctures of VDI at JavaOne

  • Sun VDI Forum

  • How to increase Logging level

  •  

    More Stories in Unix Admin Corner