Running a QEMU Windows VM in FatDog RAM-Only?

versatile 64-bit multi-user Linux distribution

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
Neo_78
Posts: 407
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 232 times
Been thanked: 11 times

Running a QEMU Windows VM in FatDog RAM-Only?

Post by Neo_78 »

I need to access a couple of Windows-based applications from time to time and was wondering if this is achievable with QEMU in FatDog on a RAM-only system using only an external USB pendrive for the Windows installation drive. So the idea is to purchase a Windows 10 or 11 license key, create a virtual system drive on a USB pendrive and use it as a VM in QEMU. So you could then plug the USB-drive in and out whenever it is required.

Has someone here tested if this is a practical idea for FatDog and what was your experience like?

I found the following guide for EasyOS:

https://www.forum.puppylinux.com/viewtopic.php?t=9028

From this guide I conclude a couple of points, but would appreciate your feedback in this regard:

- The Windows VM should be assigned 4GB of RAM.
- The Windows ISO will require around 5GB and a minimum of 11GB for the virtual HDD which I would like to create on the external USB-pendrive.
- Windows 11 seems to be difficult to install as a VM due to the TPM hardware requirement, but Windows 10 still seems to be supported until October 2025.
- Windows 10 ISO seems to be available here:

https://www.microsoft.com/en-us/softwar ... ndows10ISO

Has anyone experience with this kind of setup in FatDog?

Thanks! :thumbup:

User avatar
p310don
Posts: 369
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 73 times
Been thanked: 107 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by p310don »

I have run Win10 off of an external usb hard drive in Fatdog via virtualbox. It is definitely do-able. Not sure how Win11 goes

Neo_78
Posts: 407
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 232 times
Been thanked: 11 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by Neo_78 »

Isn't Virtualbox more resource-intensive than QEMU?

The other problem I see is the Windows license. I think you can purchase OEM license keys online. If you activate these keys for a new VM, will that license key not be associated with this specific virtual system ID?

Let's say you delete the VM in order to create a new one, will your Windows license still be usable to activate the new VM? Because the system ID of the new VM will be different now... :| Has anyone tested this?

User avatar
p310don
Posts: 369
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 73 times
Been thanked: 107 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by p310don »

Win10 can be downloaded from Microsoft and used without paying for a license. The only restriction is that you cannot customise the desktop. Whether you care about that or not is up to you.

If you install to one VM on a paid license, I'd assume you'd have a hard time moving it in future.

You can (should be able to) run a VM on different host if the settings are identical.

jamesbond
Posts: 718
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by jamesbond »

xscreenshot-20240609T160705.png
xscreenshot-20240609T160705.png (82.77 KiB) Viewed 1257 times
xscreenshot-20240609T160751.png
xscreenshot-20240609T160751.png (81.06 KiB) Viewed 1257 times
User avatar
p310don
Posts: 369
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 73 times
Been thanked: 107 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by p310don »

@jamesbond Win98 is stretching things back a bit. Wouldn't most things that run in Win98 also just run in DosBox?

@Neo_78 if you only need to run Windows things every now and again, it might be worth downloading one of these when needed:

https://developer.microsoft.com/en-us/w ... -machines/

jamesbond
Posts: 718
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by jamesbond »

p310don wrote: Sun Jun 09, 2024 8:16 am

@jamesbond Win98 is stretching things back a bit.

Let's stretch it further, shall we? :lol:

xscreenshot-20240609T193656.png
xscreenshot-20240609T193656.png (23.09 KiB) Viewed 1241 times
Neo_78
Posts: 407
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 232 times
Been thanked: 11 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by Neo_78 »

@jamesbond I actually used DosBox in FatDog to run some old DOS Games from my childhood, which worked well. However, they recommend to run DosBox within a sandbox and so far I have not found a convient sandbox approach to isolate applications without a crazy amount of configuration, e.g. bubblewrap. Firejail is easy to use but would not run in FatDog due to the AppArmor kernel requirement. Do you use a FatDog VM in QEMU on top of FatDog as your "sandbox" for DosBox?

@p310don I actually don't need to customize the desktop so if you are saying that Windows 10 can be used legally with restrictions without having to pay a license, even better.

I am not sure if QEMU has a snapshot feature like VirtualBox?

So you install Windows, install the software you need and create a snapshot of the system state, to which you can roll back every time you need to boot up Windows.

User avatar
rockedge
Site Admin
Posts: 6594
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2794 times
Been thanked: 2664 times
Contact:

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by rockedge »

I am not sure if QEMU has a snapshot feature like VirtualBox?

You can. I use AQEMU front end which makes using a snapshot fairly straight forward. Also the manual method is available:

Create_a_snapshot in a QEMU virtual machine

Another method is using qemu-img which looks like I need to work more with:

Code: Select all

qemu-img --help

Example:

Code: Select all

$ qemu-img snapshot -l myamazingqemuvm.qcow2
$ qemu-img snapshot -c testing myamazingqemuvm.qcow2
$ qemu-img snapshot -l myamazingqemuvm.qcow2
Snapshot list:
ID        TAG               VM SIZE                DATE     VM CLOCK     ICOUNT
1         testing               0 B 2023-05-21 00:57:50 00:00:00.000          0
$ qemu-img snapshot -d testing myamazingqemuvm.qcow2
$ qemu-img snapshot -l myamazingqemuvm.qcow2
$

To create a snapshot, qemu-img requires a write lock on the file, meaning it will only work for offline VMs.

Neo_78
Posts: 407
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 232 times
Been thanked: 11 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by Neo_78 »

Thanks for your feedback @rockedge :thumbup:

Are you referring to the following GUI for QEMU?

https://github.com/tobimensch/aqemu

So you are basically saying that when you take the snapshot manually from the terminal, the VM would have to be switched off at that moment?

In the EasyOS guide that I inititally referenced, you have to initially create a virtual system drive for your Windows VM, which I would like to create on the external USB-pendrive:

qemu-img create -f qcow2 winvirtualdisk.qcow2 20G

https://www.forum.puppylinux.com/viewtopic.php?t=9028

So you can create a snapshot of exactly that drive that already has been created, correct?

Using the QEMU docs that you referenced, something like:

qemu-img create -f qcow2 -b winvirtualdisk.img -F qcow2 snapshot.img

Is that correct?

User avatar
rockedge
Site Admin
Posts: 6594
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2794 times
Been thanked: 2664 times
Contact:

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by rockedge »

Are you referring to the following GUI for QEMU?

https://github.com/tobimensch/aqemu

Yes that is the one I use.

Is that correct?

Looks okay. But trying it out will tell.

Don't know if you need it so here are the steps I use to mount qcow2 .img files:

Step 1 - Enable NBD on the Host

Code: Select all

modprobe nbd max_part=8

Step 2 - Connect the QCOW2 as network block device

Code: Select all

qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2

Step 3 - Find The Virtual Machine Partitions

Code: Select all

fdisk /dev/nbd0 -l

Step 4 - Mount the partition from the VM

Code: Select all

mount /dev/nbd0p1 /mnt/somepoint/

Step 5 - After you done, unmount and disconnect

Code: Select all

umount /mnt/somepoint/
qemu-nbd --disconnect /dev/nbd0
rmmod nbd
libertas
Posts: 80
Joined: Thu Apr 22, 2021 8:35 pm
Has thanked: 12 times
Been thanked: 2 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by libertas »

Hi @Neo_78,

Some years ago, some user describe a way to to deal with qemu images that may be of interest to you.
https://www.linuxquestions.org/question ... 's-850038/
A read-only qemu image for the base install customized with programs and a running image that can be regenerated.
Any work can be saved in a networked file system.

Neo_78
Posts: 407
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 232 times
Been thanked: 11 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by Neo_78 »

A local PXE boot server (unbreakable).
+
A network partition with read-only qemu-kvm images on it (unbreakable).
Users create relative images and work on it (they can break, it, but you can regenerate the relative image in 1 second).
+
A network storage for the qemu users to save on it (never use a VM for storage).

That's what i made @ work and i can tell you i have a system that beats any 10000$ proprietary solution out there.
And it's far simpler ^^.
You can use sshfs instead of nfs. You can also use a VPN, etc...

So you are suggesting to run FatDog as a PXE boot server with a network partition containing read-only QEMU-KVM images of different operating sysyems @libertas ?

Do we have a guide for that and what hardware would typically be involved?

Clarity
Posts: 3920
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1651 times
Been thanked: 535 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by Clarity »

@Neo_78 if you are seeking a PXE solution, the simplest solution is the Ventoy PXE solution. Using it, FATDOG (FD) is the ONLY forum distro that behaves to PXE boot a LAN connected PC to a FD desktop.

Its a one-step solution.

libertas
Posts: 80
Joined: Thu Apr 22, 2021 8:35 pm
Has thanked: 12 times
Been thanked: 2 times

Re: Running a QEMU Windows VM in FatDog RAM-Only?

Post by libertas »

Neo_78 wrote: Tue Jun 11, 2024 10:10 pm

A local PXE boot server (unbreakable).
+
A network partition with read-only qemu-kvm images on it (unbreakable).
Users create relative images and work on it (they can break, it, but you can regenerate the relative image in 1 second).
+
A network storage for the qemu users to save on it (never use a VM for storage).

That's what i made @ work and i can tell you i have a system that beats any 10000$ proprietary solution out there.
And it's far simpler ^^.
You can use sshfs instead of nfs. You can also use a VPN, etc...

So you are suggesting to run FatDog as a PXE boot server with a network partition containing read-only QEMU-KVM images of different operating sysyems @libertas ?

Do we have a guide for that and what hardware would typically be involved?

That suggestion I mentioned tells about a PXE boot server, but for your use case (to boot Windows from a qemu img on a read only USB stick) it seemed to me that the suggestion to have a read-only qemu img disk with Windows could fit.
And additional changes could be made to another image file.
The PXE suggestion is not what I was suggesting.

Post Reply

Return to “FatDog64”