Changes for page Kernel-based virtual machine (KVM)
Last modified by Sebastian Marsching on 2023/05/16 20:12
From version 1.1
edited by Sebastian Marsching
on 2022/03/27 14:14
on 2022/03/27 14:14
Change comment:
There is no comment for this version
To version 2.1
edited by Sebastian Marsching
on 2022/05/29 12:53
on 2022/05/29 12:53
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Tags
-
... ... @@ -1,0 +1,1 @@ 1 +Linux - Content
-
... ... @@ -15,12 +15,12 @@ 15 15 <vcpu>2</vcpu> 16 16 <os> 17 17 <type>hvm</type> 18 - <boot dev='hd'/> 18 + <boot dev='hd'></boot> 19 19 </os> 20 20 <features> 21 - <acpi/> 21 + <acpi></acpi> 22 22 </features> 23 - <clock offset='localtime'/> 23 + <clock offset='localtime'></clock> 24 24 <on_poweroff>destroy</on_poweroff> 25 25 <on_reboot>restart</on_reboot> 26 26 <on_crash>destroy</on_crash> ... ... @@ -27,28 +27,28 @@ 27 27 <devices> 28 28 <emulator>/usr/bin/kvm</emulator> 29 29 <disk type='block' device='disk'> 30 - <source dev='/dev/vg0/myVirtualMachine-disk1'/> 31 - <target dev='hda' bus='ide'/> 30 + <source dev='/dev/vg0/myVirtualMachine-disk1'></source> 31 + <target dev='hda' bus='ide'></target> 32 32 </disk> 33 33 <!-- 34 34 <disk type='file' device='cdrom'> 35 - <source file='/root/ubuntu-8.10-desktop-i386.iso'/> 36 - <target dev='hdc' bus='ide'/> 35 + <source file='/root/ubuntu-8.10-desktop-i386.iso'></source> 36 + <target dev='hdc' bus='ide'></target> 37 37 </disk> 38 38 --> 39 39 <!-- 40 40 <disk type='block' device='cdrom'> 41 - <source dev='/dev/cdrom'/> 42 - <target dev='hdc' bus='ide'/> 41 + <source dev='/dev/cdrom'></source> 42 + <target dev='hdc' bus='ide'></target> 43 43 </disk> 44 44 --> 45 45 <interface type='bridge'> 46 - <mac address='00:0c:29:3e:9a:d4'/> 47 - <source bridge='br0'/> 46 + <mac address='00:0c:29:3e:9a:d4'></mac> 47 + <source bridge='br0'></source> 48 48 </interface> 49 49 <input type='tablet' bus='usb'/> 50 50 <input type='mouse' bus='ps2'/> 51 - <graphics type='vnc' port='-1' listen='127.0.0.1'/> 51 + <graphics type='vnc' port='-1' listen='127.0.0.1'></graphics> 52 52 </devices> 53 53 </domain> 54 54 ``` ... ... @@ -166,7 +166,7 @@ 166 166 ExecStop=/usr/local/lib/libvirt/libvirt-guests.sh stop 167 167 ``` 168 168 169 -# Choosing the disk-cache settings 169 +# {{id name="disk-cache-settings"/}}Choosing the disk-cache settings 170 170 171 171 Three different cache modes can be configured for each storage device in libvirt: _none_, _writeback_ and _writethrough_. However, these names are a bit misleading. 172 172 ... ... @@ -221,8 +221,8 @@ 221 221 Recent versions of KVM and libvirt allow you to feed entropy from the host system into a virtual machine. This can be very useful if a virtual machine needs a lot of entropy (in particular at booting) and on the host you have a source for this entropy (e.g. haveged). In the devices section of the VM configuration file, you can add the following device: 222 222 223 223 ```xml 224 - 225 - <rate bytes='4096' period='10000'/> 224 +<rng model='virtio'> 225 + <rate bytes='4096' period='10000'></rate> 226 226 <backend model='random'>/dev/random</backend> 227 227 </rng> 228 228 ``` ... ... @@ -236,26 +236,26 @@ 236 236 When installing Windows 10 inside a Linux KVM VM (or upgrading an existing system to Windows 10) the installer might crash with an "SYSTEM THREAD EXCEPTION NOT HANDLED" error after rebooting. This problem can be solved by setting the CPU model to "core2duo" as described in the [TechNet Forums](https://social.technet.microsoft.com/Forums/en-US/695c8997-52cf-4c30-a3f7-f26a40dc703a/failed-install-of-build-10041-in-the-kvm-virtual-machine-system-thread-exception-not-handled?forum=WinPreview2014Setup). For example the following entry in the VM's configuration file might help: 237 237 238 238 ```xml 239 - 239 +<cpu mode='custom' match='exact'> 240 240 <model fallback='allow'>core2duo</model> 241 241 <vendor>Intel</vendor> 242 - <feature policy='require' name='tm2'/> 243 - <feature policy='require' name='est'/> 244 - <feature policy='require' name='monitor'/> 245 - <feature policy='require' name='ds'/> 246 - <feature policy='require' name='ss'/> 247 - <feature policy='require' name='vme'/> 248 - <feature policy='require' name='dtes64'/> 249 - <feature policy='require' name='rdtscp'/> 250 - <feature policy='require' name='ht'/> 251 - <feature policy='require' name='dca'/> 252 - <feature policy='require' name='pbe'/> 253 - <feature policy='require' name='tm'/> 254 - <feature policy='require' name='pdcm'/> 255 - <feature policy='require' name='vmx'/> 256 - <feature policy='require' name='ds_cpl'/> 257 - <feature policy='require' name='xtpr'/> 258 - <feature policy='require' name='acpi'/> 242 + <feature policy='require' name='tm2'></feature> 243 + <feature policy='require' name='est'></feature> 244 + <feature policy='require' name='monitor'></feature> 245 + <feature policy='require' name='ds'></feature> 246 + <feature policy='require' name='ss'></feature> 247 + <feature policy='require' name='vme'></feature> 248 + <feature policy='require' name='dtes64'></feature> 249 + <feature policy='require' name='rdtscp'></feature> 250 + <feature policy='require' name='ht'></feature> 251 + <feature policy='require' name='dca'></feature> 252 + <feature policy='require' name='pbe'></feature> 253 + <feature policy='require' name='tm'></feature> 254 + <feature policy='require' name='pdcm'></feature> 255 + <feature policy='require' name='vmx'></feature> 256 + <feature policy='require' name='ds_cpl'></feature> 257 + <feature policy='require' name='xtpr'></feature> 258 + <feature policy='require' name='acpi'></feature> 259 259 </cpu> 260 260 ``` 261 261 ... ... @@ -287,7 +287,7 @@ 287 287 qemu-img create -f qcow2 -o preallocation=falloc /var/lib/libvirt/images/example.qcow2 128M 288 288 ``` 289 289 290 -The second option is running `fallocate` on the image file *after*the disk image has been created. In this case, the disk image can be created with the libvirt tools. However, one might also change other options (like `cluster_size`) for the image, so using `qemu-img` directly might not be so bad after all.290 +The second option is running `fallocate` on the image file _after_ the disk image has been created. In this case, the disk image can be created with the libvirt tools. However, one might also change other options (like `cluster_size`) for the image, so using `qemu-img` directly might not be so bad after all. 291 291 292 292 # Using qemu-img to make an image available as a device node 293 293