Ceci est une ancienne révision du document !
When dealing with virtual machines, a.k.a. virtual boxes, you have your choice of 3 major players: Oracle VirtualBox, VMWare, and Parallels. If you’re looking for a free one, then you’re limited to VirtualBox, since VMWare and Parallels will be dipping into your pocket. For hardcore Linux users, VirtualBox is issued under the GNU/GPL licensing structure, but the extension pack (read below) is issued under PUEL (personal use and evaluation license). All those letters mean “free” and “not for commercial use”. Versions exist for nearly every Linux distribution, including Ubuntu, Suse, Debian, Fedora, Mandriva, Red Hat, and TurboLinux (do they still develop it?). When in doubt, go to the bottom of the download list where you’ll find “All Distributions”.
Lorsque vous vous intéressez aux machines virtuelles, alias « virtual boxes », vous avez le choix entre trois joueurs majeurs : VirtualBox d'Oracle, VMWare et Parallels. Si vous en cherchez une qui soit gratuite, vous serez limité à VirtualBox, puisque VMWare aussi bien que Parallels vont vous demander des sous.
Pour des utilisateurs Linux convainçus, VirtualBox est sorti sous une licence de type GNU/GPL, mais le pack d'extensions (voir ci-dessous) est sorti sous PUEL (« personal use and evaluation license » ou licence pour usage personnel et essai). En résumé, toutes ces lettres veulent dire « libre » et « pas pour un usage commercial ». Il y a des versions pour presque toutes les distributions Linux, y compris Ubuntu, Suse, Debian, fedora, Mandriva, Red Hat et TurboLinux (est-ce que c'est toujours en développement ?) Dans le doute, allez en bas de la liste des téléchargements où vous trouverez « All Distributions » (Toutes les distributions).
Linux users will probably state that VirtualBox is really from Sun Microsystems. After all, that’s what their program heading states for their version, and even the icon states “Sun”. However, Oracle took over quite a while ago, and the website at www.virtualbox.org doesn’t even hint at Sun Microsystems any more. Nevertheless, some Linux distributions that packaged VirtualBox often have outdated variations that do state Sun. The easiest way to tell if a version is up-to-date is to look at the version number. Version 4 is the latest, and apparently the only one offered now, for reasons mentioned below. Until version 4, users had the option of VirtualBox (which I’ll call Base), or VirtualBox OSE (OSE), with the only difference being USB support on the latter. Users apparently became confused by the difference, so Oracle decided one version was sufficient - along with an extension pack to add USB support. Unfortunately, the change didn’t end the confusion, and may have added to it. You see, the extension is casually mentioned on the download page, and isn’t hyped or highlighted. It’s just there among various downloads and mumbo-jumbo, and I imagine many miss it. And that’s sad. VirtualBox is incredibly easy to use, and most will probably figure it out by just poking around, but the website is haphazardly designed, and was obviously created with aesthetics not in mind. Plain Jane comes to mind with underlined hyperlinks all over the place and an HTML help guide instead of a downloadable PDF version.
Les utilisateurs Linux diront sans doute que VirtualBox est en fait produit par Sun Microsystems. Après tout, c'est ce que l'en-tête du programme pour leur version indique et même l’icône annonce « Sun ». Cependant, Oracle l'a repris il y a belle lurette et le site web à www.virtualbox.org ne fait plus aucune référence à Sun Microsystems. Néanmoins, chez quelques distributions Linux avec VirtualBox, il y en a souvent des versions qui disent bel et bien Sun. La meilleure façon de savoir si une version est à jour est de regarder le numéro de version. La version 4 est la plus récente et, apparemment, la seule proposée actuellement, pour les raisons données ci-dessous.
Jusqu'à la version 4, les utilisateurs avaient le choix entre VirtualBox (que j'appellerai Base) ou VirtualBox OSE (OSE), la seule différence étant la prise en charge des ports USB sur celui-ci. Les utilisateurs devenant perplexes devant cette différence, Oracle a décidé donc qu'une seule version suffirait - avec un pack d'extensions pour ajouter la prise en charge de l'USB. Malheureusement, la modification n'a pas mis fin à la confusion et l'a même peut-être augmentée. En fait, l'extension est juste mentionnée sur la page de téléchargements ; on ne lui fait pas de la pub et elle n'est pas sur-lignée. Elle est juste présente parmi divers téléchargements et charabia et, je suppose, beaucoup ne le voient pas. Et ça, c'est triste. VirtualBox est incroyablement facile d'utilisation et la plupart des gens vont comprendre comment s'en servir tout simplement en essayant des trucs. Mais le site web n'est pas bien conçu et fut créé en débit des Before you start, it’s advisable to do two things before downloading and installing VirtualBox, especially on Linux. First, uninstall the VirtualBox you have if it’s below version 4. If you have version 4, keep it, and download just the extension pack (which, for some reason, is rarely included). Second, watch which OS version you download. You have your choice of Windows, Mac, or Linux, but the website doesn’t automatically read what OS you’re using, so choose wisely. You’ll have to know if you have AMD64 or x86 technology, although downloading the wrong one won’t cause any harm (you’ll get the usual “sorry” warning).
Once downloaded, installation is straightforward, with no quirks other than the usual Linux nag that another version exists in the repository (not the right versions, though). Just remember to download and install the expansion pack too, or you’ll be lacking USB support. You should see a menu heading, but I’d advise you put an icon in the panel and/or desktop for easy access. If you’re like me, you’ve already got a few hundred programs installed, and the thought of scrolling through a load of programs to find one is frustrating.
The interface is pleasantly designed, and will walk anybody through the process. If you are new to using virtual machines, I’d recommend experimenting with another version of Linux since they require no serial number or special tweaking. Once you install one guest, the rest fall right into place.
Now it’s time to clarify a couple of often-used words when dealing with virtual machines. First, the host is what you are currently using on your computer. In my case, it’s Ubuntu Linux 10.04. Second, the guest is the operating system (OS) you plan to install in the virtual machine - Windows 7 Ultimate in my situation.
Installing a guest is a simple affair - with just a few quirks you must watch for:
• Know which guest you plan to install. Yes, that sounds stupid, but you have a choice of several, and you don’t want to pick Windows 7 when you really want XP.
• Amount of RAM to devote to the guest (see my note below).
• Amount of hard-drive space and whether or not you want auto-expansion.
This is the point at which the casual or inattentive user can make bad decisions. The guest choice is straightforward, but if you intend to load Windows, be sure you have a valid disc and serial number. Failure to have either will resort in an aborted operation and a half-installed guest. You’ll find out later how that can come back to haunt you.
As for the RAM, don’t get overly zealous. Fortunately, VirtualBox will give a warning that designating too much RAM for the guest will cripple the host OS. As a rule of thumb, no more than 50% should be allocated - it was 2GB in my case. How critical is this? Recently, I was called to assist a person who had allocated all RAM to the guest thereby crippling the host. Both have to work in tandem, and they do rely on each other, so don’t overdo it.
The hard-drive choice is generally defaulted at 20GB or thereabouts, and that’s a fair amount to start with (it seems to pick about 10% of the hard drive, so this amount can vary), but make sure you check the auto-expansion option. This allows the partition to expand as your Windows or Linux OS gets larger when you add programs. Failure to check the box will lock you into the space allocated. Fortunately, if you do forget, you can go back and change that parameter; just do it before your space is full.
It appears VirtualBox reads USB ports only when peripherals are attached, but it does know the ports are there. If the expansion pack is installed properly, you’ll see a heading in the menu for USB. Failure to install the expansion pack will result in the USB area graying out. Of note, USB 2.0 is supported, but nothing is available for USB 3.0. If you have 3.0 peripherals they’ll be downgraded to 2.0 if allowable.
Once you’ve set the parameters, the magic begins. The partition is created on your hard drive, and it’ll be a couple minutes before VirtualBox asks you to insert the guest OS DVD in your drive. Linux installers can use a USB flash drive, if available, or the DVD, but Windows users are stuck with the DVD.
Normally, Windows 7 can take up to an hour or so to install on a fresh hard drive, but it takes less in VirtualBox, mainly because it borrows basic information from the host, and already knows the time, language, date, keyboard style, and other minor things. In all, VirtualBox took roughly 30 minutes to install Windows 7, and, from there, Microsoft took another hour to download a slew of updates and verify the serial number. In short, count on about 1.5 hours for a full install of Windows 7 - most of which is taken up by updates and serial number verification. XP installers can easily count on 2 hours waiting for 1GB+ of updates and security fixes (if you have an XP disc it’s out-of-date by 2 years or more, so be prepared).
Once installed, your guest OS will have a menu heading in the VirtualBox directory. Each guest OS you install gets a new heading, and I’ve personally squeezed 5 on the menu, but you can open only one at a time. Clicking on any guest heading will open a virtual machine window that you can maximize or keep as a smaller window overlaying the host desktop. A separate menu for just your guest OS will be inside that window since VirtualBox closes after opening the guest (and then reopens once you finish). There is a quirk, though. If you go full screen, the menu for VirtualBox disappears and is nowhere to be found until you run your mouse at the screen’s bottom. At that point the missing menu appears. If you opt for the smaller window the menu is always present but you lose screen real estate and may have to scroll to see pages.
Operationally there isn’t much of a difference in the guest. In my case Windows 7 worked just fine, and I could switch between host and guest at any time by merely minimizing or moving the guest virtual window.
As for file swapping, I’ve always found it to be problematic. Virtual machines like to claim that files can be swapped or read between host and guest, but my experiences have been less than successful. Sometimes they transfer, sometimes they don’t, and I’ve never gotten the same results twice. I use Windows 7 only because my work requires it, so file swapping is not a major concern for me, but if you do need to transfer files between host and guest, be prepared for trials and tribulations.
When I authorized file sharing in VMWare and Parallels, I’d often get crossover interference. When I installed music files in my Windows guest, they were opened by Windows Media Player by default, but when I closed that virtual machine and went back to my host, things got goofy. When attempting to open music files in the host, even with VMWare or Parallels closed, the guest OS would abruptly open to expose Windows Media Player. I finally learned to right-click music files to have them open with the program I wanted outside of the guest. I could understand this if the guest virtual machine was open, but VMWare and Parallels would go the extra mile by opening themselves and then the guest OS. That was just aggravating after a while. VirtualBox suffers no such ills. It never once attempted to open the guest without first asking me.
The only time you may witness interference is when guest and host programs collide. I discovered that opening Pidgin in Ubuntu while Messenger was running in Windows 7 would cause Messenger to shut down since it sensed I had signed on from a different location. Curiously, Pidgin never shut down, just Messenger.
Internet connection is a breeze. Again, the guest takes the information from the host and runs with it, although you may have to re-enter your wireless key if one exists. If you’re wondering, you will have connections in both the guest and host, and I had browsers open in both with no degradation in connection speeds.
Once you’re finished using the guest ,you have the option of shutting down, suspending, or sending a power off signal to the guest. Shutting down is obvious, and suspend merely halts the guest for future use (sort of like hibernation or sleep), but I have no idea what sending a power-off signal is. It did the exact same thing as shutting down. If you forget where you’re at, and use the Windows button to shut down, don’t worry. VirtualBox figured some users would do that, and should you attempt to shut down via that system, its menu will pop up to remind you you’re in a virtual machine, and take over by substituting its options for Windows. The only real difference in the 3 termination methods is the amount of time it takes to reactivate the guest. Shutting down and then powering back on requires a cold boot with the usual Windows 7 times, but suspending and restarting will have you up and running in about 15 to 20 seconds. This is about the same time it takes to get 7 out of hibernation on a Windows computer. Quite impressive, actually.
While it could be argued that other virtual machines such as VMWare and Parallels also save guests in their current state, they operate quite differently. Parallels on my Apple takes a good minute to open a saved desktop, and VMWare took nearly 2 minutes to open a suspended guest. Both were just slow enough that I took to shutting down the guest OS and doing cold boots to restart them since the time difference was minimal.
One thing to mention is a little quirk that may confuse some. Insert a flash drive or CD/DVD into your optical drive, and it’ll show up in both the guest and host. Ubuntu shows a desktop icon, while Windows 7 shows either a desktop or taskbar icon. But that’s half the fun. Ejecting a flash drive in Ubuntu will not eject it from the guest OS and Windows would always return with a snarky remark about removing drives without requesting permission. This is nothing unusual. USB peripherals and optical-drive discs are seen by both the host and guest, and deactivating one doesn’t necessarily do the same for the other OS.
What if you tire of a guest, and want to dump it? Go to the menu in VirtualBox and delete it. The only problem with this procedure is that the partition remains until you resize, delete or overwrite it, and this may require the assistance of GParted via Linux for the first two options (overwriting with a new guest is the easiest).
There are a few foibles to watch for, though:
• An aborted installation is bad. Forgot your serial number, or power went off halfway through? Not only do you have a dead guest, you’ve still got the partition. You have to completely reinstall the OS into the same partition to overwrite it, or use GParted to delete it.
• If you suspend your guest session for easier opening in the future, it saves everything good, bad or indifferent. Even the original time and date are saved until you manually correct them or the computer does an internet time check. Never suspend a guest session if a program locks, because it will still be locked when you come back. Reboot or shut down the guest if problems arise.
• VirtualBox names your guest upon installation, and often will use the same title twice for different versions of the same OS. Install 7 Premium and Ultimate and you may get the same title. Remember you’re picking from a pre-defined list but you can change titles at installation if you want.
• Watch the mouse movements! Moving to the far left of the virtual machine screen will cause it to collapse to the right margin. It’s still there and is still open, but you’ll have to click on the VirtualBox icon in the host to get the screen back.
• A virtual machine is no safer than a new computer installation. If you’re using Windows in the guest, don’t count on Linux as the host to be a firewall or anti-virus backup. Count on installing those in the Windows guest (and, no, they won’t conflict with any related programs you already have installed in the host).
About the only other snafu I noticed involved updating, especially if you’re using a version below 4. Seems Oracle is not updating older versions; they are just replacing them with the newest version. While helping a friend who was using an old version, I got the update warning, and downloaded the recommended new version (which automatically installed). Upon restarting VirtualBox, I got the same update warning again. Seems the download was a full program, not an update. You have to uninstall the old for the new. Fortunately, you lose nothing, and your virtual machines will still be there, but make sure you uninstall the old version! If you put icons on the desktop or panel, make sure you replace them, too. They will link back to the old version, not the new.
But the real curiosity in this test involved a peculiar twist in the overall results. VirtualBox is free, and the general theory among computer “experts” is that anything free just won’t work. These are the same persons who state OpenOffice.org suite will never be as good as Microsoft Office because the latter costs $300 while the former is free. Guess what? The experts are wrong. VirtualBox beat both VMWare and Parallels in my testing. Speed differences are dramatic with VirtualBox beating both of the proprietary competitors, and overall operations are just smoother. Sort of sad when you consider that I spent over $100 at some point for the other two, when the best alternative is the one that costs nothing. Sometimes you don’t get what you pay for.