smert.net

Polluting the Internet one post at a time…

VirtualBox vs VMware

Just over a month ago (maybe it has been longer) I saw an article on Digg about an open source alternative to VMware. I thought I would at least check it out just to see how well VirtualBox performed. I’ve also tried QEMU before and I wasn’t impressed with its speed or getting it configured to be used. VirtualBox performs very well even before you install the guest tools. It is very important to note that VirtualBox clock on the guest machine stayed perfectly in sync with the host. Which I can’t say for VMware Server and Player 1.0.2 since they varied up to 20 minutes before changing it in a Windows XP guest. The speed is near native and a Windows XP installation is faster than if you would have installed it from CD. The reason that probably is because I was using a ISO instead of using the CD. VMware on the other hand in the same situation is noticeably slower by comparison. VMware has always seemed slow for disk operations in both the Player and Server versions.

On a plus side VMware networking is a breeze. It is very easy to setup a bridged configuration so the guest can obtain its own IP address. While I can’t say how difficult it is in QEMU to configure networking VirtualBox is a pain to get setup in a bridged mode. If you are using Linux you are going to need bridge tools. You will have to create a VirtualBox interface on the command line and then create a bridge with your primary network interface. So what if you want to use NAT and configure port forwarding? There is a command line tool to configure this but it is a whole lot easier just to edit the XML configuration files once you have configured a port. The commands below will forward TCP port 22 on the host to port 22 on the guest machine. To me this command it too cryptic (lol, sendmail) to mean anything to an average user and should be shorted to something more straight forward. What a pain it would be to have to type this out and actually remember it.

VBoxManage setextradata guestname "VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/HostPort" 22
VBoxManage setextradata guestname "VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/GuestPort" 22
VBoxManage setextradata guestname "VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/Protocol" TCP

If you care to edit you XML file for the virtual machine you can add this into the ExtraData section. Obviously if you have the ExtraData section than you can just copy the ExtraDataItems into your configuration.

    <ExtraData>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/HostPort" value="22"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/GuestPort" value="22"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/name of the service/Protocol" value="TCP"/>
    </ExtraData>

What if you made a VirtualBox machine in Linux and tried to run it on Windows? Well it will work but not before you make changes to the XML file again. It will complain that it was made with a different version of VirtualBox. Which you would replace the word Linux with Windows. The sound card will be different which it will complain about an unknown type. This type of error checking should only be done when the virtual machine is started not loaded. Which is what VMware does then you could use the GUI to make the changes. There is no import tool (that I’m aware of) for VirtualBox to import an existing machine into it. Provided you don’t have any snapshots configured the best thing would be just to copy the VDI hard drive image and setup a new machine to use that VDI image. If you have snapshots setup already and you don’t want to lose them you are going to have to do some editing again with the damned XML file :( More advanced features such as copy and pasting to and from the virtual machine are not enabled by default. VMware works almost flawless between a Linux and Windows host. You can use the GUI to make correct the differences between the two. You can also import virtual machines without editing configuration files. Copy and paste is enabled once you install the VMware guest tools.

Let’s take a moment to talk about stability VMware wins in this category hands down. I’ve never seen VMware crash/lockup and become responsive since I started using it. VirtualBox is a bit less stable I probably wouldn’t run anything critical on it since during normal use it crashed. I’ve noticed on a Windows XP machine with the guest tools installed running on Ubuntu 7.04 that it would crash from time to time. I’ve seen it freeze while reverting a snapshot, it has continued to stay running after I have closed the console which prevented me from opening a new one. While reverting snapshots sometimes it will get buggy and the console won’t display the virtual machines correctly. It will either make a single machine inaccessible or most of the time it replaces the parameters with %1 or %2. The worst I have seen was when my virtual machine got into a reboot loop. I deleted the snapshot and it started working again. No critical data was lost or corrupted, I’m not sure what I could have done if I didn’t have a snapshot to delete when it kept blue screening. When you close the console it stays running for a few seconds even though the window is gone. The biggest error I’ve seen in VMware was when I was using a Windows XP host and while it was booting it failed to register all the virtual machines before it timed out. This caused the console to not open since the service wasn’t started. After starting the service it worked.

Overall on the desktop I am using VirtualBox because of the speed boost over VMware. I don’t mind the minor annoyances of it crashing from time to time. I make daily backups of my virtual machines to prevent data loss. I wouldn’t recommend using VirtualBox for anything mission critical since stability is a concern. If you have any applications that rely on the guest’s system clock to be updated accurately VirtualBox performs very well. Interoperability between Linux and Windows hosts isn’t as good as I would like for VirtualBox. Lacking features to make changes to the configuration file before it is loaded (which is when the error checking takes place). There is no importing of existing machines only the disk images but no snapshots. Bridged networking and configuring NAT is much more difficult to do in VirtualBox than it is in VMware.

Update (07SEP07)

Here is the list of supported guest OSes. Also today I tried to install a Windows 98 image which failed. After it booted for the first time the screen displayed garbage. I tried reinstalling and the problem continued.

Update (02NOV07)

Since 1.5.2 came out I don’t think I’ve seen a single crash. My networking was messed up in 1.5.0 and I can’t copy things to Windows shares without it taking an extremely long time. When 1.5.2 came out it shortly fixed the problem. Today when I went to copy something again it was slow again. I’m not sure why this is happening.

Update (10DEC07)

The slow transfer speeds seem to only happen if you are sending a file. This doesn’t happen for downloads. If I use FTP the same thing happens. I’m using the NAT interface and I’m not sure if this happens using the bridged interface. As a side note I also would like point out that the network stack in VirtualBox is entirely user-space. So you can’t ping inside the virtual machine because it uses UDP (port 7) and most hosts don’t have that port open. It doesn’t use ICMP which requires root privileges in Linux.

Update (01APR08)

I’m still using version 1.5.2 and haven’t bothered to upgrade to the latest version (1.5.6) yet. VirtualBox hasn’t crashed or froze on me since I’ve installed that version. Networking is still flaky and the transfers still don’t work well most of the time. It will send a small portion (a few kb) stop and then wait a second or so before sending another chunk. Only a handful of times have I noticed it running well enough where I didn’t notice. Sun Microsystems is also in the process of acquiring innotek.

Update (01JUL08)

Sometime ago I installed Fedora Core 9 with the latest version of VirtualBox (1.6.0). No new issues have occurred since installation, though I still get poor network transfers within the virtual machine. The virtual machine was created again from scratch since SP3 came out for Windows XP.

6 Comments so far

  1. Cuong March 31st, 2008 11:14 pm

    With the windows 98 install I found if you gave it some time to configure itself and restarted the machine a few times windows 98 figured something out and the garbage suddenly displayed the characteristic windows 98 desktop. I think I waited 5 minutes each time at the garbage screen and restarted twice and it worked in VirtualBox (Host Ubuntu 7.10).

  2. Jason April 1st, 2008 2:43 am

    How odd. I guess I’ll have to try that sometime to see if I can get it working too. I’m sure Windows 98 will run extremely fast in VirtualBox.

  3. Aaron May 3rd, 2008 11:21 pm

    I have upgraded to 1.5.6 Win2K guest Ubuntu Fiesty Host - I am still getting very slow file copys to Windows shares. If I could solve this problem I would have no complaints.

  4. Jason May 5th, 2008 12:24 pm

    It is most likely the same thing that happens to all of my file transfers. I would double check to see if it is sending a small portion (a few kb) and then stopping. I have found no work around. You might want to try bridged networking and see if the problem persists. I read sometime ago that people weren’t able to duplicate the issue using bridged (according to the bug report for slow transfers).

  5. Mona June 22nd, 2008 11:06 pm

    How do I transfer files from my computer (xp) to virtual box (xp)???

  6. Jason June 24th, 2008 12:05 pm

    There are two ways you can do this.

    1) You can create a share on your computer and then map to that share from the virtual machine. Inside the virtual machine connect to your share “\\IP Address\Share”.

    2) You can use the “shared folders” feature to basically do the same thing. You first have to setup a share by clicking the folder icon on the bottom right side of the running virtual machine. Then inside the virtual machine run “net use t: \\vboxsvr\Share”. You have to use the “net use” command since accessing it with Explorer will fail. Now under “My Computer” there will be a drive letter t: that you can access.

Leave a reply

Firefox 2