Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bed968d

Browse files
committed
arch: add notes on Windows VM
1 parent 93fe314 commit bed968d

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Arch.org

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,75 @@ To make in permanent, add the following to =/etc/fstab=
400400
#+begin_src
401401
shared /home/pavel/00-Scratch virtiofs defaults 0 0
402402
#+end_src
403+
** Windows
404+
References:
405+
- [[https://github.com/winapps-org/winapps/blob/main/docs/libvirt.md][Creating a libvirt windows VM]]
406+
407+
When creating a VM, check "Customize configuration before install". Make the following changes:
408+
1. In the CPUs tab, select "Copy host CPU configuration" and click Apply.
409+
2. In the XML version edit the =<clock>= section as follows:
410+
#+begin_src xml
411+
<clock offset='localtime'>
412+
<timer name='rtc' present='no' tickpolicy='catchup'/>
413+
<timer name='pit' present='no' tickpolicy='delay'/>
414+
<timer name='hpet' present='no'/>
415+
<timer name='kvmclock' present='no'/>
416+
<timer name='hypervclock' present='yes'/>
417+
</clock>
418+
#+end_src
419+
420+
The source says it will disable all timers except for the hypervclocks, reducing idle CPU usage.
421+
422+
Also enable Hyper-V enlightenments in =<hyperv>=:
423+
#+begin_src xml
424+
<hyperv>
425+
<relaxed state='on'/>
426+
<vapic state='on'/>
427+
<spinlocks state='on' retries='8191'/>
428+
<vpindex state='on'/>
429+
<synic state='on'/>
430+
<stimer state='on'>
431+
<direct state='on'/>
432+
</stimer>
433+
<reset state='on'/>
434+
<frequencies state='on'/>
435+
<reenlightenment state='on'/>
436+
<tlbflush state='on'/>
437+
<ipi state='on'/>
438+
</hyperv>
439+
#+end_src
440+
441+
Add this device under =<devices>=:
442+
#+begin_src xml
443+
<channel type='unix'>
444+
<source mode='bind'/>
445+
<target type='virtio' name='org.qemu.guest_agent.0'/>
446+
<address type='virtio-serial' controller='0' bus='0' port='2'/>
447+
</channel>
448+
#+end_src
449+
450+
3. In the SATA Disk 1 section, section set the Disk bus type to VirtIO.
451+
4. In NIC section, set the device model to virtio.
452+
5. [[https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/5/html/virtualization/sect-virtualization-security_for_virtualization-selinux_and_virtualization#sect-Virtualization-Security_for_virtualization-SELinux_and_virtualization][Download VirtIO drivers]]
453+
6. Add a CD-ROM device with the VirtIO driver ISO.
454+
455+
During installation, load the VirtIO driver in =\amd64\w11=. The disk should appear.
456+
457+
After installation, open the VirtIO driver ISO and run =virtio-win-guest-tools.exe=. Then, the option at View > Scale Display / Auto resize VM with window should work.
458+
459+
Configure DNS to 1.1.1.1
460+
461+
To configure a shared folder:
462+
1. Toggle "Enable shared memory" in the memory tab.
463+
2. Click "Add hardware" -> Filesystem, select virtiofs as the driver and specify the paths.
464+
3. Install [[https://github.com/winfsp/winfsp/releases/][WinFSP]] on the VM.
465+
4. Run:
466+
#+begin_src shell
467+
sc.exe create VirtioFsSvc binpath= "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" start=auto depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio Filesystem Service"
468+
sc.exe start VirtioFsSvc
469+
#+end_src
470+
5. Reboot the VM.
471+
403472
** Copying VMs between machines
404473
To copy a VM, first, copy the image:
405474
#+begin_src bash

0 commit comments

Comments
 (0)