Install Windows 10 from local .iso using Qemu

I have read here on ItsFOSS the various instructables for using QEMU and setting up a VM. Most of these are installing a different Linux distro and/or downloading the file from the web.

So I decided to first start with the document @nevj referenced installing Alpine Linux into a VM, since I had no idea how to point to my downloaded .iso file in terminal during the VM setup.

This worked mostly okay, despite the fact that I knew nothing about the network interface and how to set that up but the first issue I ran into and would like to resolve is VirtManager showing QEMU/KVM not starting/connecting.

Some research provided this (which I did, obviously without effect):

sudo apt install libvirt-daemon-driver-lxc
sudo systemctl restart libvirtd

The issue seems to be Permission Denied, and while setting up in CLI, I can chmod 700 (et al) but have not found a way to resolve this within VirtManager. The related issue also seems to be ā€œlibvirtdā€ daemon not running. Here is the error output from VirtManager:

Unable to connect to libvirt qemu:///system.

Verify that the 'libvirtd' daemon is running.

Libvirt URI is: qemu:///system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 923, in _do_open
    self._backend.open(cb, data)
  File "/usr/share/virt-manager/virtinst/connection.py", line 153, in open
    conn = libvirt.openAuth(self._open_uri,
  File "/usr/lib/python3/dist-packages/libvirt.py", line 148, in openAuth
    raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

Once I can resolve the connection, I think I can use the GUI to point to my iso for Windows 10 as well as the suggested virtio.iso I was advised to have available.

I decided to open a new topic under Tutorials & Resources due to the fact this relates to Windows, and, as such, will require additional steps or raise other issues that are relevant only to that OS.

Thanks,
Sheila Flanagan

@Sheila_Flanagan
My first reaction to this is why are you using QEMU/KVM to run W10 in a VM. Download and install virtualbox in your choice of Linux, virtualbox would be a more friendly install for a W10 VM.

Because all of my research indicates that QEMU has more tools and among them:

Giving a genuine graphics card to your guest with KVM passthrough
for high performance gaming, OpenCL, etc

I only need W10 for a few customers I do work for and since this laptop has a new, modern dGPU, I decided to use QEMU.

Additionally, I want to be able to use all methods and am starting with this one. But I will be experimenting with all methods and want to see the least amount of sys resources used in running W10.

Thanks,
Sheila Flanagan

1 Like

You can check

ps ax |  grep virt

If it is not there start itā€¦ use systemd to make it start on boot

The message says there is a permissions issue

Check your /etc/group file. User Shiela may need to be in
some group. I will go to PC and check what I have.

Can you use virt-manager at all?.. eg on a linux .iso?
When you first start vjrt-manager you get one window.
If you use that to click the menu item ā€˜New VMā€™ you get a second popup, and in there you can browse your computer files and select a .iso file. Did you get that far?

There is no problem instslling win from a .iso file. I have done it. I have win7 in virt-manager at the moment.

Sorry I cant do any more from memory. Will have to check
in my PC what my setup is.

1 Like

Output of ps ax | grep virt

myviolinsings-acer@pop-os-acer:~$ ps ax | grep virt
  24874 ?        S      0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
  24875 ?        S      0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
  27271 ?        SNsl   0:00 /usr/sbin/libvirtd
  47695 pts/0    S+     0:00 grep --color=auto virt

I was trying to use CLI and that is where I did not grasp how to point to the .iso on the Ventoy flash drive. I can use virt manager, but cannot get past the no connection:

The group file has a line item:
vboxusers:x:140:

Is my user supposed to be after that? I do appear beside some items (like admin) but not many.

I was following the instructions here but this did not allow for any issue after starting virt-manager.

sudo systemctl status libvirtd
[sudo] password for myviolinsings:          
Unit libvirtd.service could not be found.

So that would suggest I need to write a service file? I assumed one was auto generated since none of the articles I read included its creation.

I got it up and running in Oracle, once I did some display tweaking and, of course, I cannot use my dGPU except in QEMU.

Thanks,
Sheila

Here is mine

[nevj@trinity ~]$ ps ax | grep virt
  999 ?        Ss     0:00 runsv virtxend
 1000 ?        Ss     0:00 runsv virtnetworkd
 1002 ?        Ss     0:00 runsv libvirtd
 1004 ?        Ss     0:00 runsv virtnwfilterd
 1005 ?        Ss     0:00 runsv virtstoraged
 1010 ?        Ss     0:00 runsv virtlogd
 1011 ?        Ss     0:00 runsv virtsecretd
 1014 ?        Ss     0:00 runsv virtproxyd
 1019 ?        Ss     0:00 runsv virtinterfaced
 1021 ?        Ss     0:00 runsv virtlxcd
 1033 ?        S      0:00 vlogger -t virtproxyd -p daemon
 1034 ?        Sl     0:00 virtproxyd
 1039 ?        S      0:00 vlogger -t virtnetworkd -p daemon
 1040 ?        Sl     0:00 virtnetworkd
 1044 ?        S      0:00 vlogger -t virtnwfilterd -p daemon
 1045 ?        Sl     0:00 virtnwfilterd
 1046 ?        S      0:00 vlogger -t virtlxcd -p daemon
 1047 ?        Sl     0:00 virtlxcd
 1048 ?        S      0:00 vlogger -t virtlogd -p daemon
 1049 ?        S      0:00 virtlogd
 1050 ?        S      0:00 vlogger -t libvirtd -p daemon
 1052 ?        S      0:00 vlogger -t virtinterfaced -p daemon
 1053 ?        Sl     0:00 virtinterfaced
 1054 ?        S      0:00 vlogger -t virtsecretd -p daemon
 1055 ?        Sl     0:00 virtsecretd
 1068 ?        Ss     0:00 runsv virtlockd
 1070 ?        Ss     0:00 runsv virtvboxd
 1072 ?        Ss     0:00 runsv virtnodedevd
 1073 ?        Ss     0:00 runsv virtqemud
 1091 ?        S      0:00 vlogger -t virtvboxd -p daemon
 1092 ?        Sl     0:00 virtvboxd
 1093 ?        S      0:00 vlogger -t virtnodedevd -p daemon
 1094 ?        Sl     0:00 virtnodedevd
 1095 ?        S      0:00 vlogger -t virtlockd -p daemon
 1096 ?        S      0:00 vlogger -t virtstoraged -p daemon
 1097 ?        S      0:00 vlogger -t virtqemud -p daemon
 1098 ?        S      0:00 virtlockd
 1099 ?        Sl     0:00 virtstoraged
 1100 ?        Sl     0:00 virtqemud
 1108 ?        S      0:00 vlogger -t virtxend -p daemon
 1845 ?        S      0:00 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
 1846 ?        S      0:00 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
 5007 ?        Ssl    0:05 /usr/bin/python3 /usr/bin/virt-manager
21453 pts/4    S+     0:00 grep virt
[nevj@trinity ~]$ 

Bear in mind that this is Void Linuxā€¦ a lot of those processes are to do with the runit init system.

In /etc/group I have

libvirt:x:987:nevj

I have installed more than the virt-manager package

[nevj@trinity ~]$ xbps-query -Rs virt
[-] VirtualGL-2.6.2_4                                  Run remote OpenGL appli...
[-] VirtualGL-devel-2.6.2_4                            Run remote OpenGL appli...
[-] avfs-1.1.5_1                                       Virtual filesystem that...
[-] avfs-devel-1.1.5_1                                 Virtual filesystem that...
[-] bumblebee-3.2.1_8                                  NVIDIA Optimus support ...
[-] clang-15.0.7_2                                     Low Level Virtual Machi...
[-] clang-analyzer-15.0.7_2                            Low Level Virtual Machi...
[-] clang-tools-extra-15.0.7_2                         Low Level Virtual Machi...
[-] cloud-hypervisor-36.0_1                            Virtual Machine Monitor...
[-] conspy-1.16_1                                      Remote control of Linux...
[*] cryptsetup-2.6.1_2                                 Setup virtual encryptio...
[-] cryptsetup-devel-2.6.1_2                           Setup virtual encryptio...
[-] darktable-4.4.2_5                                  Virtual lighttable and ...
[-] edk2-ovmf-202311_1                                 EFI Development Kit II ...
[-] fvwm3-1.0.9_1                                      Multiple large virtual ...
[*] gnome-boxes-44.0_1                                 GNOME application to ac...
[-] guitarix2-0.44.1_3                                 Virtual guitar amplifie...
[*] gvfs-1.52.1_1                                      Userspace virtual files...
[*] gvfs-afc-1.52.1_1                                  Userspace virtual files...
[-] gvfs-afp-1.52.1_1                                  Userspace virtual files...
[-] gvfs-cdda-1.52.1_1                                 Userspace virtual files...
[-] gvfs-devel-1.52.1_1                                Userspace virtual files...
[-] gvfs-goa-1.52.1_1                                  Userspace virtual files...
[-] gvfs-gphoto2-1.52.1_1                              Userspace virtual files...
[*] gvfs-mtp-1.52.1_1                                  Userspace virtual files...
[*] gvfs-smb-1.52.1_1                                  Userspace virtual files...
[-] ipvsadm-1.31_1                                     IP Virtual Server admin...
[-] leocad-21.06_1                                     CAD program for creatin...
[-] leocad-data-21.06_1                                CAD program for creatin...
[-] lesstif-xmbind-0.95.2_6                            Configures the virtual ...
[-] libavfs-1.1.5_1                                    Virtual filesystem that...
[*] libcacard-2.8.1_1                                  Library to provide emul...
[-] libcacard-devel-2.8.1_1                            Library to provide emul...
[-] libclang-15.0.7_2                                  Low Level Virtual Machi...
[*] libclang-cpp-15.0.7_2                              Low Level Virtual Machi...
[*] libcryptsetup-2.6.1_2                              Setup virtual encryptio...
[-] libcxx-15.0.7_2                                    Low Level Virtual Machi...
[-] libcxx-devel-15.0.7_2                              Low Level Virtual Machi...
[-] libcxxabi-15.0.7_2                                 Low Level Virtual Machi...
[-] libcxxabi-devel-15.0.7_2                           Low Level Virtual Machi...
[-] libfakekey-0.3_1                                   X virtual keyboard library
[-] libfakekey-devel-0.3_1                             X virtual keyboard libr...
[*] libguestfs-1.50.1_2                                Access and modify virtu...
[*] libguestfs-devel-1.50.1_2                          Access and modify virtu...
[-] libllvm10-10.0.0_8                                 Low Level Virtual Machi...
[-] libllvm11-11.0.0_2                                 Low Level Virtual Machi...
[*] libllvm12-12.0.1_4                                 Low Level Virtual Machi...
[*] libllvm15-15.0.7_2                                 Low Level Virtual Machi...
[-] libllvm6.0-6.0.1_8                                 Low Level Virtual Machi...
[-] libllvm7-7.0.1_10                                  Low Level Virtual Machi...
[-] libllvm8-8.0.1_5                                   Low Level Virtual Machi...
[-] libllvm9-9.0.1_8                                   Low Level Virtual Machi...
[-] libomp-15.0.7_2                                    Low Level Virtual Machi...
[-] libomp-devel-15.0.7_2                              Low Level Virtual Machi...
[*] libvde2-2.3.2_25                                   Virtual Distributed Eth...
[*] libvirt-9.10.0_1                                   Virtualization API for ...
[*] libvirt-devel-9.10.0_1                             Virtualization API for ...
[*] libvirt-glib-4.0.0_1                               Glib integration with l...
[-] libvirt-glib-devel-4.0.0_1                         Glib integration with l...
[*] libvirt-python3-9.10.0_1                           Libvirt virtualization ...
[-] lld-15.0.7_2                                       Low Level Virtual Machi...
[-] lld-devel-15.0.7_2                                 Low Level Virtual Machi...
[-] lldb-15.0.7_2                                      Low Level Virtual Machi...
[-] lldb-devel-15.0.7_2                                Low Level Virtual Machi...
[-] llvm-libunwind-15.0.7_2                            Low Level Virtual Machi...
[-] llvm-libunwind-devel-15.0.7_2                      Low Level Virtual Machi...
[-] llvm10-10.0.0_8                                    Low Level Virtual Machi...
[-] llvm11-11.0.0_2                                    Low Level Virtual Machi...
[-] llvm12-12.0.1_4                                    Low Level Virtual Machine
[-] llvm15-15.0.7_2                                    Low Level Virtual Machine
[-] llvm6.0-6.0.1_8                                    Low Level Virtual Machi...
[-] llvm7-7.0.1_10                                     Low Level Virtual Machi...
[-] llvm8-8.0.1_5                                      Low Level Virtual Machi...
[-] llvm9-9.0.1_8                                      Low Level Virtual Machi...
[-] marble5-23.08.3_1                                  Virtual globe and world...
[-] marble5-devel-23.08.3_1                            Virtual globe and world...
[-] motif-xmbind-2.3.8_1                               Configures the virtual ...
[-] ngetty-1.1_7                                       Daemon for virtual cons...
[-] nodeenv-1.7.0_2                                    Node.js virtual environ...
[-] nqp-2023.11_1                                      Lightweight Raku-like e...
[-] openvswitch-2.17.0_4                               Production quality, mul...
[-] openvswitch-devel-2.17.0_4                         Production quality, mul...
[-] parrot-6.9.0_6                                     Virtual machine designe...
[-] parrot-devel-6.9.0_6                               Virtual machine designe...
[-] python3-PyVirtualDisplay-3.0_2                     Python wrapper for Xvfb...
[-] python3-virtualenv-20.25.0_1                       Virtual Python environm...
[-] python3-virtualenv-clone-0.5.4_5                   Script to clone Python ...
[-] qt5-virtualkeyboard-5.15.11+20231124_1             Cross-platform applicat...
[-] qt5-virtualkeyboard-devel-5.15.11+20231124_1       Cross-platform applicat...
[-] qt6-virtualkeyboard-6.6.0_1                        Cross-platform applicat...
[-] qt6-virtualkeyboard-devel-6.6.0_1                  Cross-platform applicat...
[-] redland-storage-virtuoso-1.0.17_6                  Redland Resource Descri...
[-] sandboxfs-0.2.0_2                                  Virtual filesystem for ...
[-] scream-3.8_2                                       Virtual network sound c...
[-] scream-alsa-3.8_2                                  Virtual network sound c...
[-] scream-alsa-ivshmem-3.8_2                          Virtual network sound c...
[-] scream-pulseaudio-3.8_2                            Virtual network sound c...
[-] scream-pulseaudio-ivshmem-3.8_2                    Virtual network sound c...
[-] scream-raw-3.8_2                                   Virtual network sound c...
[-] scream-raw-ivshmem-3.8_2                           Virtual network sound c...
[-] tinc-1.0.36_4                                      VPN (Virtual Private Ne...
[-] tox-3.28.0_2                                       Generic virtualenv mana...
[-] vde2-2.3.2_25                                      Virtual Distributed Eth...
[-] vde2-devel-2.3.2_25                                Virtual Distributed Eth...
[-] vdesk-1.2_4                                        Lightweight virtual des...
[-] vhba-module-dkms-20211218_1                        Virtual (SCSI) HBA modu...
[*] virt-manager-4.1.0_3                               User interface for mana...
[*] virt-manager-tools-4.1.0_3                         Programs to create and ...
[*] virt-viewer-11.0_1                                 Tool for displaying the...
[-] virt-what-1.25_1                                   Detect when running in ...
[*] virtiofsd-1.8.0_1                                  Virtio-fs vhost-user de...
[-] virtme-0.1.1_6                                     Easy way to test your k...
[-] virtualbox-ose-7.0.12a_1                           General-purpose full vi...
[-] virtualbox-ose-dkms-7.0.12a_1                      General-purpose full vi...
[-] virtualbox-ose-guest-7.0.12a_1                     General-purpose full vi...
[-] virtualbox-ose-guest-dkms-7.0.12a_1                General-purpose full vi...
[-] virtualenvwrapper-4.8.4_7                          Enhancements to virtualenv
[-] virtuoso-7.2.10_3                                  Scalable cross-platform...
[-] virtuoso-base-7.2.10_3                             Scalable cross-platform...
[-] vkeybd-0.1.18d_2                                   Virtual MIDI keyboard f...
[-] vmtouch-1.3.1_1                                    The Virtual Memory Toucher
[-] vpcs-0.8_2                                         Virtual PC Simulator
[-] vtwm-5.5.0_1                                       Virtual tab window manager
[*] xf86-input-vmmouse-13.2.0_1                        Xorg VMware virtual mou...
[*] xf86-video-vmware-13.4.0_1                         Modular Xorg VMware vir...
[-] xorg-server-xvfb-21.1.10_1                         Virtual framebuffer X s...
[-] xteddy-2.2_3                                       Your virtual comfort wh...
[-] xvkbd-4.1_1                                        Virtual (graphical) key...
[-] zerotier-one-1.4.0.1_1                             Network Virtualization ...
[-] VirtualGL-32bit-2.6.2_4                            Run remote OpenGL appli...
[-] VirtualGL-devel-32bit-2.6.2_4                      Run 

The ones with [*] are what I installed.
Note Void package names may differ from your Debian-based system.

I think it would be worth asking @Rosika to show you her
virt-manager setup. Rosikaā€™s is in a Debian-based system.

1 Like

I found an article on resolving issues and how to add me to the group, but it returned:

myviolinsings-acer@pop-os-acer:~$ groups
myviolinsings-acer adm sudo lpadmin
myviolinsings-acer@pop-os-acer:~$ sudo usermod -a -G libvirtd $USER
[sudo] password for myviolinsings-acer: 
usermod: group 'libvirtd' does not exist

I was able to give the read/write permission needed for user running virt-manager: the libvirt-sock file.

sudo chmod 666 /var/run/libvirt/libvirt-sock

But the libvirt-bin service file does not exist in trying to restart it.

Iā€™ll keep researching what needs to go in the service file and maybe that will fix it.

Thanks,
Sheila

Do you know what the Debian-based equivalent is for this? I tried apt-search, but that did not work.

Sheila

Okay, Iā€™m not sure other than permissions why Virt-manager suddenly connected, but I am at the install on the new VM. Will report back any issues.

Sheila

apt-cache search virt

1 Like

I am concerned about that. There should be a libvirt group.
Oh, I see libvirt NOT libvirtd

Ok, you got it.
Use browse to find the .iso file
Give it at least 30Gb of file space

Okay, I tried Import existing disk image (choosing disk: Physical Disk Device), but I donā€™t think that is the right option, as it returned not ā€˜DOSā€™

Now I am using Local install media (ISO image or CDROM) which sounds right and I have to create the ā€œpoolā€ and point to the file on the flash drive? Or do I add a volume and point to it? If new pool, should I use logical: LVM Volume Group? Or am I able to use the default filesystem directory and afterward point to the flash drive .iso.

Thanks,
Sheila

You are in the wrong place
Go to the original virtmanager control window, choose create a new VM, then when you get the popup for the new VM, use the browse option to find and click on a .iso file
It should then ask you for an OS name (or it might detect it automatically)
You dont have to create any physical device, it just knows it is a file if you browse to it. It is not like Vbox, you dont have to setup any device to read a .iso.

Yes, that is what I did before, but you do have to choose Filesystem Directory from there, browse to the Ventoy Drive and select the ISO. That is where I went wrong. Once I did that, it created the Ventoy Filesystem Directory. It did try to name the install as Windows 11 (which it is not, its 10) but I figured itā€™s just a name.

However, it then asked me about changing permissions and asked if I wanted to proceed, but choosing yes caused the following:

So I cancelled even though it proceeded to the setup for RAM & CPU. There is obviously still some permission needed beyond connection.

I will research further tomorrow and see what I come up with.

Thanks,
Sheila

I will say that my output was way longer than yours (like hundreds of lines). I have saved it, but wasnā€™t sure you need to see all that. :roll_eyes:

Should I narrow down the search for virt?

Sheila

Yes, but it is not easy.
When you installed virt-manager , it should have dragged in all the dependenciesā€¦ so it may be a wild goose chase looking for more packages.

Why dont you wait and see what @Rosika comes up with?

Why are you using a Ventoy usb drive.
Just put the .iso file on your hard disk, and browse to it there.

It seems to be trying to change permissions on the Ventoy diskā€¦ not surprising it had issues with thatā€¦ not sure why it would want to do thatā€¦ unless it was trying to put the .qcow2 file on the usb drive ???

So next question. Where is it setup to put
your VM files ( ie qcow2 files)
I think by default it puts them in your home directory. I keep mine somewhere else so it doesnt run out of space. They are big.

2 Likes

I download all my Linux OS files and utilities to it. But I will use the local .iso.

When I ran the test file, the sample.qcow was placed in home, but the others for Oracle are not and QEMU pointed to the storage in /var/lib/libvirt/images.

But I did proceed with the hard drive file and still got permission error for:
Win10.iso.

Screenshot from 2024-01-02 06-37-00

I will see if @Rosika has some input on the permissions as so far that seems to be the main thing.

One thing occurred to me (may not matter), but since I use symlinks on the internal drive to point to the external, would that make a difference in permissions since the .iso resides there? Because I noticed when I chose the local /Downloads .iso file, it showed almost 2TB for the size, and that would correspond with the external HDD. Just wasnā€™t sure in this case if that is treated like the Ventoy USB drive (concerning permissions), even though mounted.

Thanks,
Sheila

It may matter. I have had it get a bit touchy about where the .iso file is. You can test itā€¦ put the .iso file on the internal disk somewhereā€¦ even /tmp will do or /home/shiela if that is not a link.

I assume the iso file does have some sensible permissions.

1 Like