VirtualBox is great for testing out a new operating system, but your virtual machines probably aren't that special when you first set them up. Here are a few tips for making them much easier to use -- not to mention more powerful.
If you're unfamiliar with VirtualBox, it's our favourite virtualisation app, perfect for testing out a new OS or running that one app you can't get in yours. We already have a beginner's guide to VirtualBox (so go there if this is your first time), but setting up your virtual machine only gets you so far. VirtualBox is packed with more advanced features that let you run your virtual machines full screen, create "snapshots" of a certain point in time, or even run virtualised apps on your regular desktop.
Make Your Virtual Machine Run Faster
Virtual Machines share resources with your main computer, which means using them isn't going to be nearly as fast as, say, dual booting. There are a few things you can do to speed it up, however.
Allocate Your Resources Properly
With VirtualBox, you can choose which resources to allocate to your virtual machines. Try it with the default settings first and see how it runs. If you need more, you can easily increase them from VirtualBox's settings.
Open VirtualBox, highlight your virtual machine in the sidebar and go to Machines > Settings > System. From here, you can adjust how much RAM your machine gets, how many processor cores and more. Obviously, the more of these you give it, the faster it will run -- but you don't want to give it too much or your non-virtualised OS might not run very smoothly.
Generally, it's safe to stay in the "green area" of the slider. I have 8GB of RAM in my PC so I have a lot to give, so I've dedicated about half of it to a virtual machine. If you need more, RAM is one of the easiest hardware upgrades to make. I also recommend giving VirtualBox more than one CPU, if you have a quad-core CPU or above.
Enable Other Optimal Settings
You should also make sure both features under the "Acceleration" tab -- VT-x/AMD-v and Nested Paging -- are enabled. Not all processors support this feature, however, so you may have to check if yours does (and make sure it's enabled in the BIOS).
Lastly, as we've mentioned before, use a fixed-size disk instead of a dynamically allocated one. As long as you have the space for it on your hard drive, it will help your virtual machine run faster.
There are other ways to speed up your virtual machines, but these are the big ones -- check out this post from our friends at the How-To Geek for more tips.
Install Guest Additions for a More Seamless Experience
When you first set up your virtual machine, it probably runs OK. But you've probably noticed it isn't exactly seamless -- the VirtualBox window is too small and low resolution, your mouse pointer might not integrate seamlessly and so on. That's where VirtualBox's Guest Additions come in. By installing them in your virtual machine, you can make it cooperate with your non-virtualised OS much better.
Installing Guest Additions is super easy. Boot into your virtual machine, then head to Devices > Insert Guest Additions CD Image. If you open up Windows Explorer (or your file manager of choice on Linux), you should see the guest additions "disc" in the "CD drive". Double-click on it and you'll be able to install Guest Additions just like any other program.
Now, you should be able to increase the size and resolution of the VirtualBox machine, which makes running full screen a much nicer experience. Your mouse cursor should also integrate better, and you'll get a few other features which we'll describe below.
Run Virtualised Apps on Your Non-Virtualised Desktop
Once you've installed Guest Additions, you'll be able to use VirtualBox's "Seamless Mode", which lets you run virtualised applications on your non-virtualised desktop. So, if you're running a Windows virtual machine on a computer running Linux, you can run that one Windows app you need on your Linux desktop, as if it were its own separate app.
Once you've opened your virtual machine and launched your app of choice, head to View > Switch to Seamless Mode in VirtualBox. Your app (or apps) should show up on your main desktop, so you don't have your virtual machine taking up so much screen real estate.
Share Files, Devices, and Clipboard Contents
If you head to the Devices menu while you're in a virtual machine, you'll see that you can share quite a bit between your virutal machine (the "guest) and your non-virtualised machine (the "host"). (provided you've installed the Guest Additions). Here are some things you'll want to check out in that menu:
- USB and CD/DVD Devices: Hover over these options and you'll see a list of devices connected to your computer that you can share with the virtual machine. For example, if you plug a flash drive into your computer, you can mount it in the virtual machine from this menu.
- Shared Clipboard: By default, if you copy text on your host OS, you can't paste it in your guest OS. Enable bidirectional clipboard sharing from this menu, however, and you can copy and paste between your guest OS and host OS to your heart's content. Note that this only works with text, not other items.
- Drag'n'Drop: Ever wished you could just drag a file out of your virtual machine and onto your regular desktop? Enable Drag'n'Drop from this menu and you can do so, just like with the shared clipboard. Note: This feature is still experimental and only works with Linux guests. It also only works dragging files host-to-guest, not the other way around. Lastly, it does not work with folders, although you can drag multiple files.
- Shared Folders: If you have folders or files you want to share between OSes (especially since Drag'n'Drop is still experimental), shared folders are the best way to do so. From this menu you can choose folders on your host OS to share with your guest OS. Note that this features is a bit complicated and we only recommend it for advanced users. You can read more about how to mount your shared folders in the VirtualBox manual.
Take Snapshots of Certain Points in Time
Snapshots (not to be confused with screenshots) are a very cool feature of virtual machines -- with them, you can save the state of your virtual machine and come back to it later. So, if you're installing a sketchy program, for instance, you can take a snapshot, install the program, then revert to your snapshot if things go awry. I also like to take a snapshot of a "fresh" installation so I can restore it when I want a clean slate.
To take a snapshot, start up your virtual machine and head to Machine > Take Snapshot. Give your snapshot a name and description -- one that helps you remember the current state of the machine -- and click OK.
To restore a snapshot at any time, shut down your virtual machine and go to the Snapshots tab in VirtualBox, on the right-hand side of the window. Highlight the snapshot you want to return to, then click the Restore button. It will ask if you want to take another snapshot of the machine's current state first, and you can answer accordingly. When you're done, boot up the machine as normal and it will be just like you left it.
These tips should make your virtual machine run much more seamlessly. It won't feel as native as dual booting, of course, but you have the advantages of running two operating systems at once and sharing stuff between them without batting an eyelash -- no reboot necessary.