Hi, I’m an old windows user who have played with linux* a few times, but never commited to it.

I want to dive deeper and I though about installing linux in a VM. Some basic questions:

  • Is that a good idea? / Anything I should take into account?
  • Is there any preferred VM manager for this? Windows comes with Hyper-V, but I remember reading about how Hyper-V is not ideal (I could be wrong).
  • Do different distributions work better or worse on VMs?
  • Are there any major differences when using linux in a VM compared to a bare metal installation?

And some not-so-basic ones:

  • Is there any [dis]advantage to “Linux VM on Windows” VS “Windows VM on Linux”?
  • If I start with “Linux VM on Windows”, would it be possible to swap them in the future? What I mean is:
    • Virtualize the Windows installation so it can be run as a VM.
    • Un-virtualize the Linux VM (with all its contents and configuration) and move it to bare metal.
    • Run Windows VM on linux.

Notes:

  • I did a quick search and, although I found multiple articles about the topic, the ones I’ve read just show one way to do it without comparing it to the alternatives.
  • I’m aware of WSL(2), but I would like to be able to decouple from Windows in the future.
  • EIDT: I tried dual booting in the past. The main problem is that I’m too lazy to reboot every time I want to try something in linux and I end up not using it.

Thanks!

* Mandatory linux = GNU/Linux

1 point

If you’re interested in making a full jump to Linux at some point, then you’d probably be interested in dual-booting instead of using VM for Windows or Linux.

permalink
report
reply
5 points
*

I think it’s far less invasive to setup a Linux VM that can be thrown away vs. setting up dual booting.

With Hyper-V or Virtualbox the OP can have a Linux distribution installed and booting very quickly without fear of disrupting his current Windows installation.

permalink
report
parent
reply
2 points

You’re right, but is it easy to convert a VM to a physical machine? I’ve never tried, so I’m genuinely asking.

permalink
report
parent
reply
2 points
*

I’ve always gone the other way, and ran my dual booting capable install in a virtual machine

I think if you can convert the virtualhard disk into raw files it should work the other way.

permalink
report
parent
reply
2 points

It’s definitely possible to convert in both directions. I’ve never done it though. The technical hurdles made it unpalatable. My main method of moving back and forth was to keep my personal data on a separate disk from the OS disk. That way I could always take my data with me when I changed OSes or VMs.

permalink
report
parent
reply
2 points

Generally yes, but I’ve been working with VMs on various platforms for a very long time, so I’m probably not the best to qualify on what easy is. How easy will depend on what software you are using.

I’ve done many physical to virtual, and the very rare virtual to physical. Both can have problems you may need to work through (almost always driver related).

permalink
report
parent
reply
2 points

I tried dual booting in the past. The main problem is that I’m too lazy to reboot every time I want to try something in linux and I end up not using it :/.

I hope that with VMs I can have a smoother transition being able to work with both of them at the same time.

I should have added that… thanks for the suggestion.

permalink
report
parent
reply
3 points

I’m that way too. When I dual booted, I just let the default OS run. I find it better to use Linux on a VM. I’m on a mac now so I use VMs to run windows and Linux. I have a few flavors installed, but my default is Ubuntu.

permalink
report
parent
reply
4 points
*

I used VirtualBox to test Linux distributions at first. What I loved doing was install it, put it in full screen and use it one or two days the whole day using it for serious tasks and to mess around. Didn’t game on it of course because graphical capabilities in VMs are severely diminished. Thanks to this I found my true love being Debian, and I’ve been using it every day for 2 years after I’ve installed it outside of the VM.

I still do it but now I mess around in PCem with Windows 9x and pre-XP NT releases.

permalink
report
parent
reply
1 point

Do you know of any advantage of using VirtualBox over Hyper-V?

permalink
report
parent
reply
2 points

What do you use Windows primarily for? If it’s not for online multiplayer gaming (which uses anti-cheat software), then you should do it the other way around, ie install Linux as your main OS and use Windows inside a VM. That way you will be sort of forced to use Linux and adjust, and you can always fire up your Windows VM if you need to.

permalink
report
parent
reply
1 point

The only program that I’m aware I need Windows for is Photoshop (I don’t know if Wine is an option or if that counts as "Windows).

So you’re probably right. The main reason I prefer to start with VMs is to try a few distributions before committing to one of them… and the laziness I get thinking about how to migrate my current Windows installation to a VM… or (even worse) reinstalling Windows from scratch :P.

permalink
report
parent
reply
13 points

I don’t know a distribution which work better on VM but for an old Windows user, I recommand Linux Mint. Close to windows GUI and really easy to use!

permalink
report
reply
5 points

To learn Linux, yes running it in a VM is great. I used VirtualBox but also HyperV a lot, it’s nice because you can take snapshot to rollback in case of. MS HyperV has already made/configured Ubuntu image that you can use, so I’d start with that.

You can move your linux to a bare-metal one, it’s doable, but can be tricky.

permalink
report
reply
23 points

I’ll answer what I can in good conscience.

Is that a good idea?

If you keep in mind that it won’t 100 % behave like a “proper” installation when things go weird it’s fine.

Do different distributions work better or worse on VMs?

VirtualBox comes with some pre-made profile for some distributions but I’ve never been able to tell what those actually do, other than by default selecting virtual hardware that is supported.

Are there any major differences when using linux in a VM compared to a bare metal installation?

VM “hardware” is well supported, but anything requiring proper hardware acceleration (of any kind) will either perform terribly or fall back to a software-based backend. I.e. desktop compositing or hardware video decoding may or may not work as well as a native installation. Video games likely won’t work in a usable way at all, unless it’s Solitaire. Also the hard disks are decoupled from the VM to the host system and you need to manually forward USB devices to the VM or the system might not be able to detect them.

Is there any [dis]advantage to “Linux VM on Windows” VS “Windows VM on Linux”?

That entirely depends on what you want to use both systems for. If you already have Windows installed then I’d like to suggest the following path:

  • run some live USB to figure out whether your hardware is supported (graphics, sound, network, printers - especially the latter two)
  • if so, install Linux in a VM first (install multiple desktops and try them out, because why not)
  • figure out what programs are available that do the things that you usually do on Windows - keep in mind that just because $PROGRAM is written by GNOME/KDE/LXQT/… people that doesn’t mean that it won’t run perfectly fine on other desktops. Also: distributions may not ship all software, don’t forget to check Flatpak/Flathub if your distribution is missing some software.
  • try them out in the VM to see if they meet your basic requirements
  • install the Windows version of those programs on Windows
  • over time, replace the Windows programs that you used to use for the ones that are also available on Linux
  • if after a few months there are no non-Linux programs left: Congrats, back up your data and just use Linux
  • otherwise: figure out whether the programs that you need will run well enough with Wine or in a Windows-VM

If it turns out that there’s just too much Windows-only software that you can’t part with then you can just delete the VM and that’s it. On the flip side you can find software that may just happen to be better than what you used previously. Also trying out various distributions is much, much easier this way - installing the tenth distribution on bare metal because you weren’t happy with the previous nine isn’t particularly fun.

permalink
report
reply
3 points

Thank you very much for the in-depth answers. It makes a lot of sense

I’m happy to say that most of the problems won’t probably apply to me. I have a laptop with no dedicated GPU and I don’t play high end games, so I think there will be no problem with that.

Is that a good idea?

If you keep in mind that it won’t 100 % behave like a “proper” installation when things go weird it’s fine.

It’s probably impossible to list all the possible differences, but do you know what are the most common ones?

Thanks again!

permalink
report
parent
reply
4 points

It’s probably impossible to list all the possible differences, but do you know what are the most common ones?

The ones that I mentioned regarding direct hardware access of any sort.

permalink
report
parent
reply
2 points

Oh, sorry, I didn’t link the 2 parts of your comment.

permalink
report
parent
reply

Short answer: go ahead and install whichever Linux distro you like on Hyper-V and go from there.

Longer answers:

Linux works fine on VMs. There aren’t really any caveats. Hyper-V should be fine. It’s been a while since I used it but I remember thinking it was OK. I preferred it to Virtualbox; I think the Virtualbox drivers made some stuff flaky on my machine, but YMMV. I ended up shelling out for VMWare which I’d used at work. Some distros offer cloud images that are tailored for running as VMs, but unless you’re running a cluster with a lot of VMs I don’t think there’s any advantage, any distro will work. There aren’t any significant differences running Linux on a VM from running it on a physical machine.

As to which OS to use for a host, the commonly understood strengths & weaknesses of each OS apply the same as they do in other domains. Windows has better desktop hardware support, Linux tends to be more power-user friendly, etc. It depends on your priorities which you choose. Maybe the biggest factor is that Windows has Hyper-V, whereas Linux has Xen, KVM, and qemu. Either platform can use Virtualbox or VMWare.

P2V and V2P are definitely things. Searching for them online will return tools that will do this. Linux should be rather straightforward to transfer even without a specialized tool, assuming you aren’t using a distro (or distro variant) that is specially built for VMs. dd should work like a charm. It should be possible to do invert the host and guest.

If that sounds like a whole lot of nothing it’s because that’s kind of the way it is with VMs. They just work.

permalink
report
reply
3 points

Thank you very much, it seems I’m on the a right path.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.5K

    Monthly active users

  • 5.9K

    Posts

  • 162K

    Comments