Like many of you, I’m dual booting on my Framework laptop, with Linux and Windows installed on the same SSD. I’ve found a method for booting Windows in a VM in Linux and visa-versa, so I’ll describe that here.
In a nutshell, an OS installed on a disk can be booted in a VM fairly easily as long as each OS on the disk has its own EFI System Partition (ESP). I used VMware Workstation Player due to familiarity, but something similar should be possible with VirtualBox.
I started with fresh installs of each OS, but if I hadn’t, I would’ve backed up my data before starting. I suggest you do the same. If you’d like to reproduce my setup, you can follow my instructions below. In my case, I actually used Kubuntu (and soon after again with Fedora), but the instructions use Ubuntu as an example.
Installation of Windows and Ubuntu
The TL;DR for this section: if you install Linux second, you can create a second ESP during installation by selecting manual/custom/advanced installation. Windows will not mount this ESP. This is necessary for the VM configuration I describe in the following sections.
Running an Ubuntu VM (off of the disk partition) in Windows
Though VirtualBox and VMWare Workstation Player both have the necessary features, I use VMWare here.
The Ubuntu ESP must not be used to boot Ubuntu in the VM because it references Windows partitions (if the above steps were followed). An alternative is using a bootloader ISO.
Running a Windows VM (off of the disk partition) in Ubuntu
Fortunately, the Windows ESP is perfectly suitable for booting a Windows VM.
It would be wise to disable hibernate/suspend-to-disk on both OSes as soon as possible. Saving the contents of memory on one piece of hardware and then restoring them on another is obviously a terrible idea. Expect data loss.
Questions and feedback welcome.