Why Linux as a virtual machine?

Get the best from both Windows and Linux worlds

Krystian Szpiczakowski
9 min readJul 30, 2022
Photo by Alex Chumak on Unsplash

Hello again. After a longer break from writing, this time I would like to present you a slightly different topic than testing.

I’ve spent the last few months running an experiment called “Choose the best operating system(s) for yourself”. More specifically, I wanted to find out how to get the best from both Windows and Linux worlds at the same time.

I agree, this topic has been discussed since the dawn of time, and this matter can be highly subjective. Nevertheless, I would like to share my observations with you, so that you don’t have to go through it yourself, and perhaps this article will help you make the final decision about your next system configuration.

I am going to cover this topic in three separate articles:

  • Windows and virtualized Linux
  • Windows and Linux as dual-boot
  • Windows Subsystem for Linux

Let’s get started!

When you have too much free time

You know that feeling when you obviously have too much free time and stupid ideas start popping up? I’ve been in this state for the last few months, trying to find the best user experience as a regular computer user, and as a software developer. The funny thing is that I did have everything I needed, but I didn’t know that yet. But let’s start from the beginning.

Throughout all the years that I use computers, I have used both Windows and Linux, and I installed them in many combinations, i.e.

  • Windows as the only OS (operating system) on my computer
  • Linux as the only OS
  • Windows as the main OS, and Linux installed as VM (virtual machine)
  • Windows installed alongside Linux (a.k.a. dual boot)
  • Windows Subsystem for Linux, or just WSL

All these options have some pros and cons, and I’ve been taking a closer look at the last three of them over the past few months.

Initial configuration: Windows 10/11 and VM with Linux Mint

Before I started my experiment, my setup looked like this:

  • Windows 10, and 11 after upgrade, as the main operating system (personal use, entertainment, and so on)
  • Linux Mint Cinnamon running in VirtualBox (mainly for learning purposes, with development tools)

Why Windows as the main operating system?

Why did I choose Windows as my main operating system? Well, I use it mainly because:

  • Windows offers overall good user experience
  • I use paid software available only on Windows
  • I want my printer to work as it’s supposed to
  • I sometimes play games (not only on Steam)

User experience? I know, some desktop environments available for Linux offer good user experience, too.

Windows software? You may say: “find an alternative available on Linux”, or “use Wine instead”. Well, I tried to use Wine a few years ago, and I don’t want to struggle with it once again. Briefly, Wine didn’t work in my case at all. As an example, I use Hitfilm Express with paid plugins for video editing, and this program is not available on Linux. Theoretically speaking, I could switch to DaVinci Resolve, which comes with a Linux installer, but I’m used to Hitfilm Express workflow, plus, I didn’t want to get rid of software I paid for.

Another thing to remark is Windows has much better support for printers compared to Linux, and this is really important to me — I will cover this topic later on, when I’ll be talking about a Linux installation alongside Windows (so-called dual boot).

Lastly, I occasionally play games, and they sometimes don’t come from my Steam library. Fortunately, this issue had the least weight among all criteria.

Why Linux as the virtualized operating system?

I really like Linux and enjoy using it. That’s why I decided to set up my development environment on Linux, and wrap the environment into VM.

I can name many things I like in Linux systems:

  • the way software is managed by packages
  • virtual desktops were present long before Microsoft introduced them on Windows
  • a vast choice of desktop environments available out there
  • lower memory consumption compared to Windows
  • you feel like a geek when you issue commands in terminal :)
  • and more

However, there are still some aspects that make me angry in 2022 while using Linux as the main OS. To mitigate these cons, I decided to use Linux as a virtual machine — you’ll read more about the disadvantages of standalone Linux installation in the next episode, when I’ll be writing about dual boot.

Overall experience

Generally speaking, I was quite happy with Windows as the main OS and virtualized Linux. The performance of this configuration was decent in my opinion, and I couldn’t complain.

So that you have a reference point, here’s configuration of my laptop:

  • processor: Intel Core i7–9750H
  • memory: 32 GB RAM
  • graphics: NVIDIA GeForce RTX 2060
  • storage #1: 1 TB SSD
  • storage #2: 1 TB HDD

Good things

When I wanted to do a regular stuff on my computer, I simply used Windows. On the other hand, when I wanted to do something more specific, like deepening my bash skills, or even learning more about Java/Python/Docker/whatever, I typically did this on my virtualized system. At this point, you could ask me a question: “Why is that? You can install those and a plethora of other tools directly on Windows.” That’s true, but I wanted to separate my tools for learning and software development from my regular environment, plus, by using tools in a Linux environment I can learn Linux itself at the same time — so many benefits!

Additionally, using VirtualBox let me suspend my virtual machine at any point, and later on refreeze it, so that I didn’t have to relaunch all opened applications over and over again. If you don’t know this feature, this reminds pretty much the sleep feature in your computer, so you can sleep your VM even if you physically shut your real computer down.

Another thing worth mentioning are snapshots. If you’re a type who is curious too much, this may be something for you. For example, if you’d like to know what is going to happen to your operating system if XYZ, then no worries and just check it out! In the worst case, you will just restore your virtual machine to the point, where everything worked just fine — provided you took a snapshot beforehand :). This can also be useful, when you want to upgrade your virtualized system. Remark, your virtual machine is just a normal operating system, but wrapped into the box. This means, the virtualized system gets also updates, and during a bigger upgrade something can go wrong. This is why you can also leverage snapshots as a safety net and take a snapshot before system upgrades.

Sometimes, there is a need to exchange files between your main OS and the virtual machine. To make it possible, VirtualBox lets you create shared directories and exchange files bidirectionally. Communication between the host and Linux.

I also want to mention, that installation of a virtual machine is super easy compared to dual booting — no issues with accidental overwriting bootloader, or not so trivial partition resizing. Finally, if you come to the conclusion that you don’t like this particular system, you can just remove the entire installation just like you would do with a normal file on your computer.

Bad things

Unfortunately, if you want to use a virtual machine, there are also concerns you should keep in mind:

  • your computer’s resources like CPU, memory and so on must be shared between running systems
  • there is a slight performance penalty for using a virtual machine
  • if you are about to run very resource-intensive tasks on the VM, it may turn out that your host operating system only needlessly eats up your precious resources

Let me give you an example. I installed Windows 11 very recently, so there’s no much rubbish installed over there yet. Windows doesn’t care, though, and eats up 4 GB of RAM right after boot up. Linux Mint Cinnamon takes less than 1 GB of RAM on idle, so it has four times less appetite than Windows in terms of memory consumption (at least on idle). Nevertheless, both systems already consume 5 GB of RAM just running on idle. When you start doing something on your VM, you can easily take up another few GB of RAM. I would say, if you want to run virtual machines and use them comfortably, then 16 GB of RAM is an absolute minimum nowadays.

Windows uses over 4 GB of RAM on idle
Linux Mint needs less than 1 GB of RAM on idle

Also, the CPU needs to have decent performance. For example, I have never used U (ultra low power) series of Intel processors, but because they aim for better mobility and longer battery life, I am not sure if they are suitable for running virtual machines — if you know something in this topic, please share your experiences with me in the comment.

Having said that, I indeed experienced performance issues, but these were rather related to my whimsy and not a real problem. It turned out, that my virtual machine was not ready to be displayed on a 4K TV.

Typically, I used a regular 1920x1080 monitor as my secondary screen, and on one screen I was doing some stuff on Windows, and on the secondary screen I was working on VM. However, one day I decided to do something on Linux from my couch in a living room, so I plugged my laptop to a 4K TV, and the “fun” has begun while displaying a virtual machine in default 4K resolution.

I noted, that when 3D acceleration was enabled in VirtualBox, the performance of the desktop environment was somewhere between “it’s unusable” and “so-so”, depending on what actually I was doing. As I was typing the text, I felt a slight delay all the time. Finally, I ticked the 3D acceleration off, and the problem with poor performance was still present, even crashing Cinnamon session occasionally. That was quite interesting to me, so I decided to test a number of other distributions in VirtualBox. I tested at least Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, Pop OS, Linux Mint, openSUSE, Fedora 36, and there were always smaller or bigger issues while using the 4K TV as my secondary screen. I also tested VMware Workstation Player instead of VirtualBox, but the results were pretty much the same. That day, I understood that my expectations for displaying virtual machines in 4K were most likely too high. If you really want to use your VM on a 4K screen, lower the screen resolution to Full HD (1920x1080) first.

Conclusion

Let’s summarize pros and cons of using Windows as the host OS, and Linux as the guest OS:

Pros

  • good overall performance of the VM (if you have enough resources)
  • super easy system installation and removal
  • if you are curious about a new OS, a virtual machine is a perfect solution
  • no risk of breaking the main system during installation of the second
  • you can isolate a set of tools and don’t clutter the main system (e.g. development environment prepared in the virtual machine)
  • you can take snapshots of the virtual machine, and bring the system back later on in case of a failure
  • you can experiment with the system, even break it deliberately for curiosity, and bring it back

Cons

  • you may need a powerful computer to run intensive tasks on your VM (your computer has to handle two operating systems at once)
  • tasks that heavily rely on GPU cannot be achieved by using virtual machines (VirtualBox can’t use GPU)
  • rather impossible to handle a 4K resolution by virtualized Linux (at least based on my case)
  • clipboard integration between the host OS and guest OS not always works properly

In the next article I’m going to tell you about my experience with dual booting, so stay tuned.

--

--