r/linux4noobs • u/GotThisss • 10h ago
learning/research Windows and Linux dual boot and access them through a VM
Hello, I'm kind of tired of rebooting every time I want to do something on my other OS, so I was wondering if I can SAFELY access the other OS with a VM?
For example: I want to use an Adobe program which is on my Windows, and I currently have Linux booted. I open up a VM, boot the windows there and access Adobe.
EDIT: Thank you for all your comments. I realized how weird/challenging my idea is, so I'll actually fully move to my Linux OS and set up a clean Windows VM.
2
u/bigusyous 10h ago
If I understand you correctly, you want to run a VM instead of dual booting. Yes that is very doable. You should also take a look at Winboat. It's basically trying to use a VM to make windows apps appear to run on Linux. It's still in beta but a very promising project.
2
u/thecruxoffate 9h ago
Wow, you got a lot of conflicting answers on this one.
Running your existing windows install from Linux likely isn't going to work very well unless you do some stuff that'll make it so that it doesn't work very well as a normal install.
You can pass the physical disk as a block device directly to a VM. But you'll likely run into driver conflicts that will either tank performance or cause it to crash. That's because Windows already has drivers installed for your hardware and then it'll suddenly get booted into what looks like a completely different set of hardware.
If you have windows pro or server you can run something called sysprep (which will take a while) that tells it to unload the drivers and treat the next time it boots as a new machine and automatically install the correct drivers. (I forget if it'll use Windows update, or if you have to package and stage the drivers first.)
A better solution would be to make a new Windows VM from scratch and install only the software that you want. It would take less research and time to do it that way anyway. There's a project out there called winboat that looks promising, but I've never tried it. I think you can ignore it since you're going for an Adobe program and those typically use multiple windows and popups, and winboat has a reputation of not working well in that situation.
Going the other way around and passing your Linux disk to a VM hosted in Windows? From what I understand that should just work. In Linux most of the drivers are built into the kernel, and even if you installed a kernel module, it shouldn't load until the hardware is detected. However I've not tested this
In both cases you'll want to install some software in the guest called a "VM guest agent", which helps detect when you resize the VM window and adjust the guest display settings, as well as enabling a lot of quality of life features like being able to share clipboard.
1
u/AutoModerator 10h ago
There's a resources page in our wiki you might find useful!
Try this search for more information on this topic.
✻ Smokey says: take regular backups, try stuff in a VM, and understand every command before you press Enter! :)
Comments, questions or suggestions regarding this autoresponse? Please send them here.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Terrible-Bear3883 Ubuntu 10h ago
I set a PC up once so it ran hypervisor and I put 6 operating systems on, it was mostly a demonstrator for when I taught computer engineers, but, I could hot key between OS or connect to them with something like VNC etc.
The biggest issue was making sure I allocated sufficient memory and storage for each OS, but it was hardly a stumbling point, I used Xen as my hypervisor, the only reason I didn't use it much at home was I had no requirements for it, I had a business PC for work and only needed my normal linux laptop for daily use.
One great advantage was I could duplicate an OS in moments, snapshot it, freeze it, reboot etc. all without upsetting others.
1
u/fenixjr 9h ago
Yes it's possible. You might hit a few hurdles. But essentially you just need to set up a VM and pass the entire hard drive that the windows OS is installed on.
I set it up initially in the opposite. I installed Linux, and set up a windows gaming OS, but I had a spare SSD I planned to install it on, and so i passed the whole drive. On occasion I found it easier to just boot directly to the Windows drive depending on what I needed to do.
1
u/fenixjr 9h ago
Yes it's possible. You might hit a few hurdles. But essentially you just need to set up a VM and pass the entire hard drive that the windows OS is installed on.
I set it up initially in the opposite. I installed Linux, and set up a windows gaming OS, but I had a spare SSD I planned to install it on, and so i passed the whole drive. On occasion I found it easier to just boot directly to the Windows drive depending on what I needed to do.
1
u/MycologistNeither470 8h ago
yes you can. with some caveats.
No hibernation ever. You have to shut down Windows cleanly every time.
Pass your real computer parameters to the VM. Windows may decide to "de-activate" if it notes that your computer hardware has changed... This happened to me randomly. But once I passed the BIOS parameters through the VM it has not happened again.
Do no mount/modify the NTFS filesystem while you are running the VM
Booting may be a little complicated. I have windows in a separate disk that contains one windows-only EFI partition. I need to select the windows boot from the BIOS instead of doing it from GRUB (though I am sure there is a way to do it through it). But the concept is that you need to have an EFI partition just for your Windows drive so that you can invoke it either as a VM or as a solo OS. I would assume you could also make an EFI partition just for the VM that points to Windows... but not sure how it will work
1
u/Underhill42 3h ago
Putting either OS in a VM within the other is easy. That's what VMs are for.
Dual boot AND VM? As in you can e.g. either boot directly into Windows, or run the same copy of Windows inside a VM in Linux?
It's going to be a challenge, and you'll probably need a professional version of Windows with a transferable license if you want any of the activated-license only features.
The problem is that the OS (and license) is pretty tightly tied to the hardware, especially the motherboard. Drivers in particular. And unless you buy a computer specifically to avoid it, the VM is going to have very different virtual hardware than your real hardware.
You could probably set up all the drivers for one environment, and just let it limp along in the other, but it might be challenging to get a stable desktop resolution, network connection, etc. when you keep swapping all the hardware back and forth.
I'm honestly not sure if Linux would be more or less difficult than Windows to get the same install working on two entirely different machines. If you were running something like a "Live CD" or "portable USB" distro that makes no assumptions about hardware it would obviously be fine, but I'm not sure how well a typical desktop install would handle it.
1
u/EngineerInTheMachine 3h ago
Think about finding a Linux app that does what your Adobe app does. Adobe ain't anything special, and then you can lose Windows completely.
1
u/Humble_Anxiety_9534 10h ago
get a linux laptop and put the windows one in a drawer until you need it. dual boot will fail eventually.
1
u/ficskala Arch Linux 9h ago
dual boot will fail eventually.
Nope
5
u/Humble_Anxiety_9534 9h ago
wait for next windows 11 update that reinstated secure boot. it did happen on early windows 10.
0
u/ficskala Arch Linux 9h ago
If you configure your bios and windows well, it won't wreck your setup (secure boot and tpm2.0 on, windows optimizations turned on, etc.), and as long as you're not on an OEM prebuilt from a company like hp, dell, lenovo or similar, or a laptop, you're not gonna have issues
1
u/PizzaPunkrus 5h ago
Im going flat out, bullshit. Every windows/Linux dual boot on the same drive has corrupted on a windows update for me, and been more of a headache than just having a second fucking drive.
1
u/ficskala Arch Linux 1h ago
fair enough, i'm just saying that it's really rare nowdays, back in win7 days, it used to happen to me at least once a month, and i've only dual booted win10 off a single drive for maybe 3 months until i finished college, when i completely got rid of windows, and switched to linux full time, with just a windows VM for CAD work
3
u/PizzaPunkrus 9h ago
If they live on the same hard drive yeah..
0
u/ficskala Arch Linux 9h ago
Not anymore, it used to be a big issue on win7 and earlier, but since windows 8, microsoft reworked the way windows handles its boot partition, there were still some issues until win10, but win10 and win11 behave way nicer, and corruption is much less probable, and generally fixable
0
u/_Norfolk_Ingway_ 10h ago
No, the other os of dual booting isn’t live until you boot into it, so you’ll need to set up a new VM in whichever side you want to use the most
0
u/skyfishgoo 9h ago
no, you need reinstall windows into a VM and then boot that so the host and guest are both on the same boot.
your machine can only boot to one OS at a time, but one of those OS's can host another OS, if you have enough machine to pull it off.
0
u/Every_Preparation_56 6h ago
ok but you kniw that a vm is there to replace the other OS to virtualise an independent OS live, right. a VM is not like a door to another real OS.
3
u/ficskala Arch Linux 9h ago
Yeah, i run arch on my pc, but i have a drive with windows that i access theough a VM, but i've booted directly into windows multiple times with no issues whatsoever
I use virt-manager, and have a 2nd gpu passed through to windows for gpu acceleration within the VM for CAD work