Skip to main content

Platforms and Technology

Developing in a Virtual Machine: 4 Time-Saving Optimizations

The default settings on a freshly downloaded virtual machine (VM) are great if all you need to do is view and maybe debug your website in IE11 or Edge, but if you want two screens or just need more pixels, need to run more programs, or write and compile code, you have to make some virtual machine optimizations.
The tips and settings referenced here are specific to VirtualBox virtual machines from Microsoft, but can probably be applied in several other VM environments.

1. A Checklist of Quick VM Optimizations

Configure your virtual machine’s memory allocation and other settings to help with performance. Do this before you start the machine up so your adjustments will become available when you sign in. Otherwise you can shut down the VM and run through the following checklist.
Settings Updates:

  1. Settings > General > Advanced > Shared Clipboard (Bidirectional) – This could help if you have already written some code on your Mac and need to copy and paste it into the VM.
  2. Settings > System > Motherboard > Base Memory (12288 MB)
  3. Settings > Display > Screen > Video Memory (256MB)
  4. Settings > Display > Screen > Monitor Count (2)
  5. Settings > Display > Screen > Acceleration (check Enable 3D Acceleration)

Virtual Machine (VM) Display Setting Optimizations
Virtual Machine (VM) Display Settings Dialog Box

2. More Pixels Please

You’re not confined to that tiny default viewport. In the Devices menu, select “Insert Guest Additions CD Image.” This will be equivalent to inserting a CD into an optical drive. Be aware that this isn’t going to do anything other than hopefully prompt an installation wizard. You still have to run the program to install add-ons. (Select “Run VBoxWindowsAdditions.exe.”)
Virtual Machine (VM) Viewport Settings
If you don’t see the installation wizard pop up, you might have to navigate to the CD drive in File Explorer and manually run the program to install add-ons. This will allow you to set your virtual machine screen resolution to 1920×1080 and give you the screen real estate you’re missing.
Virtual Machine (VM) Screen Resolution Settings
Also in the View menu, take the following steps:

  1. Select View > Auto-resize Guest Display.
  2. View > Virtual Screen 1 > Resize to 1920×1080.
  3. View > Virtual Screen 2 > Enable
  4. View > Virtual Screen 2 > Resize to 1920×1080.

Note: You might have to reboot after updating some of these settings if you’re not seeing the changes take place right away.

3. Take a Snapshot

Now that you can see and have taken care of some optimization and configuration settings, install whatever programs you’re going to need like Visual Studio, NVM for Windows, Node, Git, etc. Make sure you have everything you think you’re going to use, then go back to the VirtualBox Manager window and take a snapshot (top right) so you can restore your machine with all the settings you just spent all that time configuring.
Virtual Machine (VM) Snapshots

4. Check Your Code In

Make sure to use Git often for virtual machine backups. If, for some reason, your VM decides it doesn’t like you one day and forces you to reinstall everything, at the very least you’ll be able to pull down your code and pick up where you left off.
If you need to work in a Windows environment, for example you need to compile your code with Visual Studio, you can run through the list of adjustments above and get your VM set up to develop in, then take a snapshot so you can easily reset back to a good working environment if your license expires.  Also, don’t simply rely on your virtual machine file system.  Even a shared folder between your VM and host system could be wiped out with the click of a button, so at least push a WIP commit before you shutdown.
If you’re looking for more tips on virtual machine performance, you’ll most definitely find a ton of help on Stack Overflow and VirtualBox.org forums.  Please feel free to chime in with any other tips or related comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Michael Bergen

Michael Bergen is a Web Apps Architect with 5+ years of agency experience and has been with Perficient Digital out of the Irvine office since 2017.  Before working with enterprise clients, he worked with a small, ambitious team at a start-up developing cutting-edge digital signage for school districts across the country.

More from this Author

Follow Us