Accessing secondary hard drive from a virtual machine

,

I recently have been thinking on switching to Fedora 40 (Plasma KDE) from using mainly Windows 11 and instead want to have the Windows OS as a virtual machine for gaming purposes after upgrading my SSD. I have most of my data on my laptop’s secondary internal hard drive (an HDD) but I also want to have the hard drive be readable from the virtual machine. Is this possible?

And if so, which virtualization program should I use?

If you want to be able to access the data simultaneously from both Linux and Windows, you will probably want to install Samba on your Linux system and then have Windows map a drive letter to the content that is being exported from the Samba service.

The other way is to pass the whole device to the virtualization program (e.g., something like qemu-system-x86_64 -drive if=virtio,format=raw,file=/dev/sdb ...), but if you do that, you must be careful not to mount the filesystem on both Linux and Windows at the same time or else your filesystem will become corrupted and your data will be lost.

I see, thanks for the input. I think I’ll steer clear from the other way in case I end up being clumsy.

I’m sorry to bother you again, but how do I go about making Windows map the drive letter to my Samba service?

It used to be a menu option in Windows Explorer (Super+E should open Windows Explorer). They did away with those menus a few versions back though. For a while, you could trigger the menus to reappear by pressing the Alt key. I’m not sure if that works anymore.

Edit: You have to right-click on “Network” and “Show more options” to get to the “Map network drive …” menu option in Windows 11.