There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Can a Linux installation be run as a VM in Windows?

This might sound daft, but something similar used to work with live discs.

I’ve got Windows 10 and Mint 21.1 dual booting on my computer at the moment. Every so often I’ll realise that I’ve missed something from my Windows installation. If it’s important, I then have to boot to Windows to get the information, or the settings etc.

Is there a way to virtualise my Mint installation so that I can run both the OSs at once to make sure that I’ve got everything?

VirtualBox had a tool to do this with a live USB, but that was back in the MBR days, so it probably won’t work with modern hardware.

EDIT: Sorry, I should clarify, Mint and Windows are on the same physical disc, and the plan is to remove Windows once I’m done.

colournoun ,

I succeeded in doing this once long ago. Then while in the Linux vm I wiped the VM’s partition table, which wiped the physical disk partition table, including windows. Do not recommend.

Dagamant ,

I did this back in 2008 using virtual box. Had a dual boot system and got curious as to whether or not I could boot the Linux partition as a VM. I don’t remember it being difficult to do but this was before EFI and secure boot so those may cause trouble. I’m not 100% sure I used virtual box either :/

Tippon OP ,

I remember doing it with a file that came with one of the multi ISO tools, LiLo perhaps? It was just named VirtualiseThisKey.exe and would open the key as if it was booting on a PC. I deleted it back last year though as my copy had been corrupted, and I hadn’t used it for a long time so didn’t bother replacing it.

NarrativeBear ,

I run a Hackintosh’s dual booting Mac OS and Windows. So you solution is not insane as some have pointed out.

What I would suggest is maybe running a NAS on your local network to act as your share. Obviously this won’t help if you dont store your working files on your NAS, but its an idea. I know no way to directly share between the two machines as they are technically not on at the same time.

Tippon OP ,

Thanks, but the sharing itself isn’t the issue. I’ve got three other hard drives in this computer, and can access them all through each OS. What I want to be able to do is be using Windows and realise that I want something from a program on the Mint drive, or have Mint running and realise that I need something from a program on Windows, and just be able to get it without having to shut down everything and reboot.

I’ve got programs like Thunderbird where the data has to be exported before it can be imported in the Mint version, and the program has to be running for that to happen. With my memory, I keep forgetting about things like that until I’m in Mint and need the data, but in the time it takes me to reboot, get the data, and get back to Mint, I’ve forgotten why I needed it in the first place >.<

axum ,

This is definitely as XY problem and your solution is kinda insane.

Just install ntfs drivers on Linux, and ext4 drivers on windows.

Or if you truly need both constantly at the same time, ditch the physical install and commit to WSL

lemann ,

AFAIK on Windows the physical disk containing the partition needs to be marked offline in Disk Management, and the disk or a partition given exclusively to VirtualBox running as administrator, otherwise access is limited to read-only

I would suggest checking some other sources as well, just in case this has changed over the years. If you do successfully pass the physical partition into VirtualBox read-write, you might need to set up a virtual disk with grub to boot into your physical Linux partition

Tippon OP ,

Yeah, that’s what another user found too. It doesn’t look like VirtualBox can do it, but this thread suggests that VMWare might be able to. I’m just trying it now :)

superuser.com/…/boot-physically-installed-linux-i…

BananaTrifleViolin ,

What you’re asking is if you can run the existing Linux Mint on your drive within Windows running on the same drive?

It may be feasible if VirtualBox or VMWare are able to access/mount the existing Linux partition as if its a virtual drive, and boot the OS but its likely to be difficult. The main issue is that windows does not easily mount Linux partitions. It is also an edge case use for most users so there will likely not be much guidance on how to achieve this easily.

It might work more easily the opposite way round - boot Linux and mount Windows within Virtualbox but is not likely to be straightforward. Windows may be less flexible about being booted into a virtual machine with totally different hardware.

All this may be overkill to the problems you’re trying to solve. You can mount the existing NTFS Windows drive within Linux Mint to access all your windows files without any virtualization. But I’m not clear what “settings” you’re looking at when you boot back in to windows? That seems to be the stumbling block. Is is specific software / tools you’re trying to migrate settings for?

Another approach may be to launch windows, create a new linux Mint VM in Virtualbox, share a folder between Linux VM and Windows host, create whatever settings you’re trying to migrate in your VM Linux Mint, and when happy copy the home folder / settings folders into the shared folder. Then boot your PC into linux, mount the windows drive and pick up the settings files from the shared folder to migrate into your main Mint system. But whether that is even worth doing depends on what you’re trying to migrate.

Tippon OP ,

What you’re asking is if you can run the existing Linux Mint on your drive within Windows running on the same drive?

Yes, exactly this. It used to be possible with live usb keys years ago, where you could boot the key normally and have a persistent live disc, but there was a Windows tool that would virtualise the key, letting you access the persistent disc from within Windows.

The reason I want to do it is for programs like Thunderbird, where you have to export your settings, email, etc. to be able to import them on the other OS. As far as I’m aware, this can’t be done by just copying files, you have to export them first.

I have memory issues, so I often forget about a program until I need to use it, and if I’m already in Mint, it means that I have to stop what I’m doing and reboot, and then lose track of what I was doing in Mint. If I can access both OS at the same time, like with a virtual machine guest and host, I can just grab whatever I need until I’ve got everything transferred over.

Mountaineer ,
@Mountaineer@aussie.zone avatar

I think all the existing answers are on the basis of creating a new Linux VM.

And if I understand you correctly, you already have a bare metal Linux install that you want to run whilst Linux is up.

This is the best search result I could find: forums.virtualbox.org/viewtopic.php?t=93437

It sounds like Virtualbox will indeed create a pseudo vhdx that points to a real partition, but windows is going to give you permissions drama.

The above link is out of date though, so its best viewed as info rather than guide.

Good luck.

Tippon OP ,

Thanks for the link :)

Unfortunately, it doesn’t look like they got it working from a partition, but I’ve found this link for VMWare that might work:

superuser.com/…/boot-physically-installed-linux-i…

thisisbutaname ,

Yes, you can run Linux in a VM.

But also: you should be able to access your Windows partition from Linux, as it supports NTFS and FAT filesystems, and view the files there.

What I do is I have one partition with Windows, one with Linux, and a third one (with an NTFS file system) for the files I need to access from both.

Tippon OP ,

Sorry, I should have clarified, I’ve got a data disc, but I’m forgetting about things that need to be migrated, like Thunderbird profiles and Syncthing. As far as I can tell, I need to export them first, and then import them in Mint. If I set Mint as a VM, I should be able to do it all in one go and hopefully not forget anything else :)

walthervonstolzing ,
@walthervonstolzing@lemmy.ml avatar

If you’re using the ‘Pro’ or ‘Education’ license for Windows 10, you can look into Hyper-V, which should allow you to boot a VM from a physical disk.

Hyper-V is built-in to Windows; & you just need to enable it in system settings.

Not sure if it works with partitions, if you’re dual booting the OSs from separate partitions on the same disk – it probably doesn’t; in which case you might need to migrate Mint to its dedicated disk first.

Tippon OP ,

Yeah, it’s partitions that I’m dealing with. My goal is to transfer everything over, give it a few weeks to make sure that I haven’t missed anything, then wipe Windows from the partition so that Mint has the full disc.

stardustsystem ,
@stardustsystem@lemmy.world avatar

Hyper-V will work with physical disk, but be warned - the wizard you run through when making a VM will make it look like you give the VM a VHD file for storage or nothing. Just attach no storage to the VM initially, then go into the VM settings after the wizard is complete to attach something besides a VHD.

Can’t entirely remember if it handles partitions but I know it can boot particular disks and if the setting exists, that’s where it would be

Tippon OP ,

This is what I’m trying at the moment. I found this question on Super User that suggests it can be done, but like you say, the wizard makes it look like you have to use a file first.

superuser.com/…/boot-physically-installed-linux-i…

osaerisxero ,

This is one area where Win11 (and maybe an updated win10?) might have a leg up: my hyper V has the option of adding a disk later in the wizard, which allows me to go into IDE controller 0 and mount a physical disk in the new vm's settings:

https://files.catbox.moe/ss8pwv.png

https://files.catbox.moe/nr9rdl.png

Tippon OP ,

I might have hit my limit :(

VMware is letting me do something similar, and I’ve attached the Mint partition, but because the boot partition is separate and in use, it’s not letting me go any further. There’s probably a way around it, but it’s beyond what I know how to do, and I don’t want to risk breaking my Mint installation.

Blue_Morpho ,

Windows has hyperV VM manager built in.

TheBigBrother , (edited )

Yes it can…

Hint: VirtualBox

Tippon OP ,

Can VirtualBox boot from the same physical disc as Windows? I’ve got Mint and Windows on separate partitions on the same disc for now.

BearOfaTime ,

Virtualbox runs in windows (or Linux).

But it’s a dog as far as virtualization goes.

Tippon OP ,

Sorry, yes, I know what VirtualBox is. My problem is that I want to access my existing Mint installation through my existing Windows 10 installation. Mint and Windows are on the same physical disc in separate partitions, and I don’t want to have to reboot to do something like export my Thunderbird settings and emails from the Windows client if I’m in Mint.

It’s a temporary stopgap solution while I switch because I have memory issues, and only tend to remember things when I need to use them (probably ADHD related, but that’s another story)

TheBigBrother ,

Not possible AFAIK.

Tippon OP ,

Unfortunately, it looks like you’re right :(

I can get VMware Player to recognise the partition, but the boot info is on another partition. As that partition is already in use, I’m getting an error. It might be possible to create another boot partition, or put the relevant info onto the Mint partition, but that’s just going to make things even more complicated, and it’s not worth it just to save some time.

Zohran69 ,

Yup. Sure can. It’ll run as good as the system Resources’s you allocate during the install. I run them quite often with virtualbox

Tippon OP ,

That’s good to know :)

Is there anything special that I need to do, or do I just boot from the Mint boot drive?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines