diff options
Diffstat (limited to 'tools/qemu.html')
-rw-r--r-- | tools/qemu.html | 98 |
1 files changed, 89 insertions, 9 deletions
diff --git a/tools/qemu.html b/tools/qemu.html index 1c58e49..fc0f15c 100644 --- a/tools/qemu.html +++ b/tools/qemu.html @@ -43,22 +43,17 @@ this describes how to create a qcow2 type;</p> <pre> - $ qemu-img create -f qcow2 crux-img.qcow2 15G + $ qemu-img create -f qcow2 crux-img.qcow2 20G </pre> - <p>You can mount disk image;</p> + <p>Qemu disk images can be treated as regular disks using + qemu disk network block device server;</p> <pre> $ sudo modprobe nbd $ sudo qemu-nbd -c /dev/nbd0 /crux-img.qcow2 </pre> - <p>To disconnect image disk (ndb);</p> - - <pre> - $ sudo qemu-nbd -d /dev/nbd0 - </pre> - <p>Information about preparing <a href="../core/install.html#step2">partitions</a> and <a href="storage.html">storage</a> administration. @@ -100,6 +95,13 @@ # mount $BLK_VAR $CHROOT/var </pre> + <p>Before disconnecting image, clean dev mappings;</p> + + <pre> + $ sudo kpartx -d /dev/nbd0 + $ sudo qemu-nbd -d /dev/nbd0 + </pre> + <h2 id="net">2. Network</h2> <p>Network configuration;</p> @@ -232,11 +234,89 @@ <p>Set guests machines to run under the total resolution provided by host system configure grub on the guest with gfxmode;</p> + <h3 id="guest">Guest Graphics</h2> + + <p>Get current resolution on host machine;</p> + + <pre> + $ xrandr --current | fgrep '*' + 1366x768 60.00*+ + </pre> + + <p>Set grub gfxmod on guest machine, edit /etc/default/grub;</p> + <pre> - GRUB_GFXMODE=640x480 + GRUB_GFXMODE=1366x768 GRUB_GFXPAYLOAD_LINUX=keep </pre> + <p>Update grub configuration on guest machine;</p> + + <pre> + # update-grub + </pre> + + <h3 id="sound">Guest Sound</h3> + + <p>Check if DMAR is enable on kernel configuration, + Intel and AMD uses different technology. To check on + Inter machine run;</p> + + <pre> + # grep -e DMAR -e IOMMU + </pre> + + <p>runvm/profile/crux</p> + + <pre> + export QEMU_AUDIO_DRV=alsa + #export QEMU_AUDIO_DRV=sdl + + + #boot=$1 + boot=c + + iso=iso/crux-3.2.iso + #iso=$2 + + #image=$3 + image=img/crux-img.qcow2 + + #tap=$4 + tap="tap1" + + #mac=$(rmac_addr) + mac="54:60:be:ef:5c:72" + + other="-soundhw hda" + </pre> + + <p>runvm/runvm.sh</p> + + <pre> + function rmac_addr (){ + printf '54:60:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) + } + + source profile/$1 + boot=$2 + + #mac=$(rmac_addr) + + qemu-system-x86_64 \ + -enable-kvm \ + -m 1024 \ + -boot ${boot} \ + -cdrom ${iso} \ + -hda ${image} \ + -vga std \ + -display sdl \ + -device e1000,netdev=t0,mac=${mac} \ + -netdev tap,id=t0,ifname=${tap},script=no,downscript=no \ + ${other} \ + &> + </pre> + <a href="index.html">Tools Index</a> <p>This is part of the c9 Manual. Copyright (C) 2016 |