Windows KVM config


Recommended Posts

Hi all,

 

I want to setup a Windows VM using KVM and am looking for a working config file. I don't want any fancy pass through gubbins, I just want to be able to install it and access it via rdp.

 

I did have one running under Xen, but now that I've switched to non-Xen mode I want to start again.

 

Holding my hands up at the start - I've not yet googled it - hoping that someone out there will have a config I can use out of the box. ALl of the examples I've seen here in the forums seem to be using pass through etc.

Link to comment

You can use mine from here http://lime-technology.com/forum/index.php?topic=33927.0 just remove these lines ( for pass trough)

 

<qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=root.1,addr=00.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=pcie.0'/>
  </qemu:commandline>

 

Works great with RD

Link to comment
  • 1 month later...

Tried to get a Windows 8.1 VM up and running after upgrading my rig. Would like to just get it started before I attempt any passthrough. Getting the following error

 

error: Failed to create domain from Win8.xml

error: Cannot get interface MTU on 'br0': No such device

 

Here are the files contained on my VM drive

root@Tower:/mnt/VM# ls
Win8.xml  Windows8.qcow2  en_windows_8_x64_dvd_915440.iso  virtio-win-0.1-81.iso

 

Here's my XML

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows8</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa9d</uuid>
  <memory unit='GB'>2</memory>
  <currentMemory unit='GB'>2</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <boot dev='cdrom'/>
  </os>
<features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/VM/Windows8.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/VM/en_windows_8_x64_dvd_915440.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/VM/virtio-win-0.1-81.iso'/>
      <target dev='sdd' bus='sata'/>
      <readonly/>
    </disk>
    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>
    <interface type='bridge'>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <memballoon model='virtio'/>
  </devices>

</domain>

 

Any suggestions? Very inexperienced with virtualization, especially using the command line.

Link to comment

Okay got the VM up and running and I was able to use TightVnc to access and install Windows 8 but after installation is complete I have no network connectivity inside the windows VM. Any help is appreciated, XML below  :D

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows8</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa9d</uuid>
  <memory unit='GB'>6</memory>
  <currentMemory unit='GB'>6</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <boot dev='cdrom'/>
  </os>
<features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/VM/en_windows_8_x64_dvd_915440.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/VM/virtio-win-0.1-81.iso'/>
      <target dev='sdd' bus='sata'/>
      <readonly/>
    </disk>
    <disk type="file" device="disk">
		<driver name="qemu" type="qcow2" />
		<source file="/mnt/VM/Windows8.qcow2" />
		<target dev="vda" bus="virtio" />
	</disk>
    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>
    <interface type='bridge'>
      <source bridge='docker0'/>
      <model type='virtio'/>
    </interface>
    
    
    <graphics type='vnc' port='5900'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    
    <input type='mouse' bus='ps2'/>
    <memballoon model='virtio'/>
  </devices>

</domain>

Link to comment

I believe so. I installed all the drivers located in the Win8/AMD64 directory. I am using docker0 as a bridge, do I have to create a br0 bridge instead? Not quite sure how to do that....

 

Here's the output of ifconfig

docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.42.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 56:84:7a:fe:97:99  txqueuelen 0  (Ethernet)
        RX packets 16827  bytes 969498 (946.7 KiB)
        RX errors 0  dropped 418  overruns 0  frame 0
        TX packets 30343  bytes 52199467 (49.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.102  netmask 255.255.255.0  broadcast 192.168.0.255
        ether d0:50:99:27:72:61  txqueuelen 1000  (Ethernet)
        RX packets 616646  bytes 130553793 (124.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 807100  bytes 939107559 (895.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 162900  bytes 1042509376 (994.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 162900  bytes 1042509376 (994.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:54:00:39:b2:66  txqueuelen 500  (Ethernet)
        RX packets 796  bytes 117632 (114.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3349  bytes 276220 (269.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Devices.jpg.a416601545c4b8a1e37f2f6647ddfac6.jpg

Link to comment

docker0 is wrong bridge to use!

 

 

go to unraid settings network and activate the bridge, give it a name, 'br0' for example, and use br0 in the xml file.

 

should then looks like this........

 

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.190  netmask 255.255.255.0  broadcast 192.168.0.255
        ether bc:5f:f4:75:8a:21  txqueuelen 0  (Ethernet)
        RX packets 631564  bytes 1137156798 (1.0 GiB)
        RX errors 0  dropped 6797  overruns 0  frame 0
        TX packets 479069  bytes 212573537 (202.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.42.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 56:84:7a:fe:97:99  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether bc:5f:f4:75:8a:21  txqueuelen 1000  (Ethernet)
        RX packets 1632522  bytes 1858590598 (1.7 GiB)
        RX errors 0  dropped 42  overruns 0  frame 0
        TX packets 1426337  bytes 998421776 (952.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.