Using Linux in a VM as Your Daily Driver

by JMT

After having used Linux exclusively at home for nearly a decade, I recently found it necessary to switch to Windows, for professional reasons.  I hated the idea and looked for any way I could find to avoid it.  But in the end, it couldn't be helped.  (Executive summary: both my personal Linux computer and my work Mac Mini died at the same time, but I could only afford to buy one new computer.)

I began to wonder, though: are Virtual Machines (VMs) good enough to use as a daily driver?  Short answer: Yes.

In fact, it works so well that I would likely keep it this way even if my initial reason evaporated.  However, it was neither easy nor obvious how to get it working smoothly in the beginning - good enough to use all day, every day, for everything.  So I just wanted to share how I got my VM working well enough to use as my main computer, and what some of the advantages and disadvantages are.

The Basic Setup

To replace both computers, I bought a 12-core Core i9 @ 3.4 GHz with 64 GB of DDR5, two internal SSDs, and a GeForce 3070, with Windows 11 installed as the host.  Since this is a powerful system, I can afford to give the VM the resources it needs to function smoothly.  The VM is Pop_OS! 22.04 running as a guest inside VirtualBox on the D:\ drive, with control of eight cores and 32 GB of memory.

I use Windows 11 exclusively for work, and use the VM as my personal computer.  I treat them as if they were two separate machines, one at home and one at the office.

The Advantages

This setup is a dream.  Creating it was an act of desperation, but now I wouldn't want to switch back.  My daily driving experience in the VM is flawless.  I can access any drive I need, including network drives.  The VM has full control of the NIC, so I get 100 percent of my available bandwidth, and the ability to effectively use a VPN, when such things become necessary.  Audio and video sound and look great (I do get minimal screen tearing occasionally, but not nearly as bad as my initial tests, and not bad enough to bother me, even though a good experience watching video is one of my deal-breaker use cases).

When my VM is full-screen - which it always is if it's running - I forget I'm even using a VM.  But when I remember, it affords additional advantages: I can back up my entire computer and save it to an external drive in case anything goes wrong; I can create restore points before I make major changes, and roll them back if necessary; I can try out new distros any time, without impacting my main machine in any way.  Hypothetically, I could even buy a brand new computer, and just bring my VM over wholesale; I could copy it onto my laptop, and take it with me on vacation; I could back it up offsite.  The list goes on.

All of that is just the upside of basic, daily computing.  But for my particular use case - as a freelancer using my personal computer for both my livelihood and my home life - there are additional advantages.  First, the two are completely separate.  When I work, I shut down the VM and use Windows, and at 5pm I relaunch the VM.  They are psychologically discrete spaces for the two sides of my life.  Also, my Windows installation stays pristine - I installed the apps I need for work, and that's it.  I don't have to worry (much) about something suddenly breaking my Windows PC, and with it my ability to earn a living.

Prior to this setup, I used Linux on bare metal, with a Mac Mini next to it for work.  In between I had a KVM switch and a USB switcher and an audio switcher so I could use all the same speakers/monitors/peripherals.  None of that extra bloat is necessary now, because everything is plugged into one computer.

The Disadvantages

The downside is surprisingly small.  In order to put the Windows host to sleep, I have to shut down the VM each night.  I use "Save State," so I just relaunch it in the morning and everything is as I left it.  When I plug in a USB drive, I have to go through the extra step of routing it to the VM - but even that is only if it's a drive I might want to access on Windows.  For any ext4 formatted drives, the system routes them automatically through to the VM.  Occasionally I have trouble getting a drive recognized, and I have to unplug it and plug it back in.  As minor as these are, they are the only downsides I can think of.

The Deets

I tested VirtualBox, VMware, and Microsoft's built-in Hyper-V platform.  I also played with Windows Subsystem for Linux (WSL).  But none of them worked out-of-the-box well enough for a daily driver.  There were numerous crashes, and audio/video playback was unacceptable across the board.

Since nothing was working, I settled on VirtualBox just because it's what I was most familiar with, so troubleshooting it made the most sense.  I am certainly not saying the others won't work, just that I never got them to work well.  Here's how to do it with VirtualBox.

Windows

There are numerous virtualization features of Windows 11 that conflict with the smooth running of other virtualization platforms, including VirtualBox.  In my testing, I found that with these enabled, I had severe crashing and network throttling in my VM - all of which disappeared once these were removed.  So let's start by disabling them all:

Search for and run "Turn Windows features on or off"

Disable the following:

  • Hyper-V
  • Virtual Machine Platform
  • Windows Hypervisor Platform
  • Windows Subsystem for Linux

Device Guard must be disabled separately:

  • Run PowerShell as "Administrator"
  • Run gpedit.msc
  • Computer Configuration --> Administrative Templates --> System --> Device Guard
  • Right-click, choose Edit
  • Select Disabled then Apply

VirtualBox

Next, create your virtual machine in VirtualBox; install your OS and VirtualBox Guest Additions.  Your configuration may differ, but here are some of the settings I changed to ensure the best possible experience in the VM:

Display

  • Video Memory: set to maximum (256 MB)
  • Enable 3D Acceleration: checked (research indicates this setting may cause instability in some setups, but in my testing it was key for a good video watching experience)

Audio

  • Enable Audio Input: checked (for video chatting, etc.)

Network

  • Bridged (this mode gives the VM full control of the network card, allowing for the use of a VPN.
  • Promiscuous Mode: Allow All (just in case you want to run Wireshark).

USB

  • USB 3.0 (xHCI) Controller (to ensure fast external drive access)

Guest Virtual Machine

You should now have a stable VM with smooth local audio/video playback.  However, in my testing at this point, watching YouTube in Firefox was still subpar, with occasional audio popping/ crackling that I found to be a deal-breaker.  Thankfully, I found a fix:

In Firefox, go to about:config and set these parameters to false:

media.webspeech.synth.enabled
reader.parse-on-load.enabled

Shared Folders

You will probably have the need to move files between host and guest at some point, so it's a good idea to set up a shared folder.  In the settings for your VM:

  • Click the + to add a new folder
  • Folder Path: [choose a path on the host]
  • Folder Name: [choose a name, or leave blank and VBox will handle this automatically]
  • Mount Point: [choose a mount point for your guest, or leave blank and VBox will handle this automatically]
  • Read-only [unchecked]
  • Auto-mount [checked]
  • Make Permanent [checked]

Now you'll have an easy way to move files between host and guest.  (Note that if this setting is not available to you, you have neglected to install VirtualBox Guest Additions in your guest operating system.)

External USB Drives

Accessing your data stored on external drives is important, and won't be a hassle.  There are two ways to do it: temporary and permanent.

The easiest way to grab a USB drive that's plugged into your host is to press your Host Key (default is right Ctrl) +Home and then navigate thusly: Devices --> USB --> [device].  (Pro Tip:  You can use arrow keys instead of the mouse.)  This will immediately "plug it in' to the guest VM.

For a more permanent solution - e.g., an ext4 formatted drive that you will never use with your Windows host - simply set up a USB filter.  Filter rules tell VirtualBox to grab whatever meets their criteria and pass it through to the guest VM any time it's plugged in.

Do this by opening the settings for your VM, go to the USB section, and under USB Device Filters, click the + icon and select your drive from the list.  It will create a rule that identifies your specific drive (or other USB device), and passes it to the guest VM immediately upon insertion.

Final Thoughts

I am writing this from within my virtual machine configured as described in the paragraphs above.  I live my life in this computer and 99 percent of the time I forget it's even a VM.  This started as a workaround to the problem of not being able to afford two new computers simultaneously, but now I wouldn't go back.  If I hit the lotto tomorrow, I would keep it this way.  If I suddenly didn't need Windows any more, I would probably install Linux on the hardware and continue running this VM on top of it to keep the work/life separation and all the benefits outlined above.

I did tell one white lie.  My Windows installation is not 100 percent work, because of course I installed Steam on it so I could finally play CyberPunk 2077.  Hack the planet.

Return to $2600 Index