1

So I've recently decided on switching to Linux and running windows from within it (for day-to-day programs and games) and have Linux as a main OS for delicate stuff like bank details, etc...

Issue is I can't find anything explaining how this can be done, and since I'm a complete noob when it comes to Linux I've decided the best course of action would be to post here about it and see what you guys think and if anyone knows how to do this.

My current specs are: I7-6700k, 16Gb of DDR4 RAM, RTX2060, a main drive of 250GB and another of 1TB (both are m.2 NVME SSDs).

What I'm looking forward to do in detail is:

  • Have Linux contain all important information

  • Run a virtual machine (with Windows) with almost all the resources of the computer for applications that don't run on Linux

  • Be able to have a moderately smooth operation with said Virtual machine (within obvious machine related restraints)

I do not need any specialized programming on Linux but am 100% willing to learn as long as it benefits the privacy of my data.

Looking forward to hear from everyone, thanks!

1
  • An alternative to your security concerns would be to have two accounts in MS-Windows, but never install drivers, or run software as admin from 3rd partys. I hear that MS-Windows is reasonably secure these days, as long as you are not hiding from the government, running for government office, … (or doing anything else that the NSA may be interested in (Hi Jeff how are the kids)). Jun 16 '20 at 16:27
2

While VMs are great for high-performance compute applications, the one area that they have a lot of overhead in is graphics. If you've ever tried to use a VM, no matter if it's a Linux or Windows host with a Linux or Windows guest, with KVM, Hyper-V, VirtualBox, or VMWare, you've probably noticed that it's very low frame rate, has little hardware graphics acceleration, and is overall not friendly to use for graphical purposes, and probably completely unsuitable for gaming. Typically, high-performance gaming VMs use an additional graphics card dedicated to the VM itself through projects like Looking Glass, which is passed through.

This is going to be fairly (read: very) hard, so you should probably stick with dual-booting.

However, there is a solution: passing your GPU through entirely to Windows and disconnecting it from Linux. You'll need to enable PCI-E passthrough in your BIOS—typically called IOMMU. After that, there's a project that will set this up entirely, then pass through your GPU, keyboard, and mouse to Windows, and then disconnect them once you shut it down. Here's a general installation script for Debian-based distros (such as Ubuntu, which you should probably use as a beginner) as the guide is mostly written for Arch Linux:

  • Run sudo apt install qemu ovmf git libvirt in your terminal
  • Edit /etc/default/grub and add intel_iommu=on iommu=pt to GRUB_CMDLINE_LINUX_DEFAULT. For example, if it was empty before, it should now be GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on iommu=pt".
  • Verify that IOMMU works. Run sudo dmesg | grep -e DMAR -e IOMMU and make sure that you see some output.
  • Flash a new VBios on your GPU that allows it to be passed through. This is fairly hard. Follow these steps or this video up until 7:15.
  • Download VirtIO drivers for Windows: pick the most recently modified folder and then the file "virtio-win.iso" within it.
  • Download Windows from its website.
  • Follow the rest of this tutorial from step 3. In "edit the script" in step 4, replace lightdm everywhere you see it with gdm. Change windows.sh in step 6 to windows-virsh.sh.
7
  • That's sounds rather complicated to my knowledge. You mentioned dual boot, does that mean I can have Linux and Windows on the same drive and then switch between the two? Say I store critical information like banking information only on Linux and then I use Windows as normal but without the "critical information". Does that sound viable?
    – Rui
    Jun 16 '20 at 16:11
  • @Rui Yes, and there's also many more guides for that. Sometimes booting will break when Windows does an update, but it will give each OS full usage of the hardware. Technically, malware on the Windows partition could harm or access the files on Linux when they couldn't in a VM, but the benefits greatly outweigh the downsides.
    – lights0123
    Jun 16 '20 at 16:13
  • That's more reassuring than nothing. For my needs do you think it'll suit me? If so would you mind linking to well based guides on how to create said dual boot?
    – Rui
    Jun 16 '20 at 16:15
  • I agree. However doing hardware pass-through (or duel boot), is tearing down the wall between host and guest. The OP is concerned with security. Unfortunately this is a choose two situation: MS-Windows and GNU/Linux at the same time, performance, security, choose two. Jun 16 '20 at 16:16
  • @Rui itzgeek.com/post/…, use step 7a when you get to it. Install Windows first, then get Ubuntu started. When booting your installation disk for both OSes, make sure that if you see multiple entries in your motherboard's boot menu that you select the option that starts with UEFI.
    – lights0123
    Jun 16 '20 at 16:18
0
  1. Install VirtualBox or VMWare Player (I recommend the former since VMWare Player often has troubles with new kernels)
  2. Create a VM preferably with a fixed size disk (to avoid VM disk fragmentation). Allocate maybe 4-6GB of RAM for the VM and maybe 2-3 CPU cores.
  3. Download a 64bit Windows installation ISO.
  4. Insert the ISO into your VM and power it on.
  5. After installing Windows, install VirtualBox additions. You can eject the DVD now.

You're basically done.

Some notes:

  • Enabling EFI support in VirtualBox is not really necessary but can be done. I've found zero difference between running UFI and non-EFI versions.
  • You can install a 32bit Windows version instead, and in this case you don't need to allocate more than 3GB of RAM for it but then your Windows applications won't be able to allocate more than 2GB of RAM.
6
  • Hi, this solution seems rather simple to what I expected and that's cool. In regards to the Linux distribution I should use do you have any recommendations and/or guides for that? Thanks a lot!
    – Rui
    Jun 16 '20 at 15:49
  • I personally prefer Fedora but at times it can be unstable. If you want to install Linux and forget about it for many years, xubuntu.org/download Xubuntu LTS is the best choice. Ubuntu by default runs Gnome which I personally dislike for too many reasons. Jun 16 '20 at 15:56
  • Which beginner friendly one would you recommend the most to me? I've heard Ubuntu is the most popular one, not sure if this is true or not. Also on the matter of virtualization does do the VB and VMWare handle drivers by themselves or are there any issues I should take not beforehand?
    – Rui
    Jun 16 '20 at 16:02
  • Linux by itself is not very user-friendly, and again Ubuntu LTS could be the best choice for you. Both handle kernel drivers by themselves but again with VBox you'll run into fewer troubles. And in my experience it's faster. The last version of VMWare which I recommended was 5.5 but that was ages ago and now it cannot be even used with modern distros and it doesn't support new Windows versions. Jun 16 '20 at 16:04
  • I would go with Debian: I know it works well, and it does not try to take away your freedom. Ubuntu and MS-Windows do. Jun 16 '20 at 16:08
0

What you need is to do following

  1. Install VirtualBox

https://techamor.com/installing-virtualbox-in-ubuntu/

  1. Download Windows ISO from Windows Website.

https://www.microsoft.com/en-in/software-download/windows10

  1. Create a VM on Virtual Box and install Windows

https://www.extremetech.com/computing/198427-how-to-install-windows-10-in-a-virtual-machine

  1. Use Windows and Linux Simultaneously

You need to tell us what is a specific issue if any to help you further.

Let me know if this helps.

7
  • Hi. In regards to the Linux distribution I should use, do you have any recommendations and/or guides for that? Thanks a lot!
    – Rui
    Jun 16 '20 at 15:50
  • If you have not used much before, I would suggest you go for Ubuntu. Jun 16 '20 at 15:52
  • Thanks for the quick reply back! Assuming I install Ubuntu and do the Virtual Machine trick, are there any issues on running games and/or driver related issues that might happen or is it handled by the VM like a normal Windows installation?
    – Rui
    Jun 16 '20 at 15:53
  • Running Games totally depend on hardware requirements.. The Windows 10 VM will be sharing resources with Ubuntu. I cant comment which games can give issues. I have tried games like American Army and Call of duty a couple of years ago and it ran fine. Cant comment on the latest versions Jun 16 '20 at 15:55
  • Let's say I want to run something like Witcher 3. My specs are stated on my post, is it runnable from the VM? that's the question I was asking
    – Rui
    Jun 16 '20 at 15:57
-1

What you are looking for is Virtual Box. However:

  • Performance of games will be poor. Enabling 3D acceleration will help, but will blow a hole in the wall between the guest and host.
  • Gnu/Linux has good game support now (not as many as MS-Windows, but lots). Gnu/Linux is the OS that many mistakenly call Linux: Linux is the kernel used on Gnu/Linux, android and other OSes), Gnu/Linux is a UNIX like OS (or a Unix).
  • Using MS-Windows for everything will not progress you toward the day that you are free.
  • Everything that you do in MS-Windows can be done in Gnu/Linux. Not always the same tools though. There are a few app types that are still lacking e.g. 3D CAD.

MS-Windows and GNU/Linux at the same time, performance, security, choose two.

To keep security separation between the host and guest VMs do stuff, that is not performent. There are solutions to increase performance, in theory to make the guest on par with the host. However this is done by removing the barrier between the guest and host.

With duel boot, each OS can do what ever it wants. e.g. access and change the all data, modify the other OS, …

5
  • Hi thanks for the reply! For reading what you've said it means that with a VM I have security and with dual boot I have performance but never the two together. Is that correct?
    – Rui
    Jun 16 '20 at 16:21
  • 1
    1) User did not ask for freedom 2) "Everything that you do in MS-Windows can be done in Gnu/Linux" - that's a lie. 3) "Gnu/Linux has good game support now " it's never had good support unless support means Wine/DXVK or Steam/Proton which do not guarantee anything 4) The user has never mentioned gaming even once 5) "MS-Windows and GNU/Linux at the same time, performance, security, choose two" - again, a lie. I've been running Windows in a VM since the early 00s and never had any issues with performance or security. Jun 16 '20 at 16:23
  • @ArtemS.Tashkinov I have had to performance problems ether but then I don't play games (first sentence of question). I have also not had any security problems with MS-Windows, but then I don't have to admin it. Every thing that you can do it true, just not every app (I mentioned CAD as an example). But it can do everything (Maybe you have to write a program). Jun 16 '20 at 16:34
  • Maybe you have to write a program can you write a program like 3D Max? Yes, that's a CAD application but there are literally thousands of others which are not available in Linux in any shape or form. Jun 16 '20 at 16:40
  • @ArtemS.Tashkinov Stop agreeing with me. Jun 16 '20 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.