aboutsummaryrefslogtreecommitdiff
path: root/DOCS.md
blob: 0ca4c6ad99c1a31f5fb35b4867afabeb9a85d242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# KVMX Documentation

Misc documentation on kvmx and qemu.

## USB hotplug support

* Good to have `usbutils` package in the guest.

* Docs:
  * https://qemu.readthedocs.io/en/latest/system/usb.html
  * https://github.com/qemu/qemu/blob/master/docs/usb2.txt
  * https://wiki.gentoo.org/wiki/QEMU/Windows_guest
  * https://www.linux-kvm.org/page/USB_Host_Device_Assigned_to_Guest
  * https://en.wikibooks.org/wiki/QEMU/Devices/USB/Root
  * https://wiki.archlinux.org/index.php/QEMU#Pass-through_host_USB_device

* Issues:
  * https://serverfault.com/questions/666210/attaching-usb-dongle-to-kvm-vm
  * https://unix.stackexchange.com/questions/119335/how-can-i-simulate-usb-storage-device-connection-with-qemu#119530
  * https://unix.stackexchange.com/questions/452934/can-i-pass-through-a-usb-port-via-qemu-command-line#452946
    kvm - Can I pass through a USB Port via qemu Command Line? - Unix & Linux Stack Exchange

  * https://unix.stackexchange.com/questions/310271/camera-passthrough-in-qemu-kvm-linux-guest-machine
    Camera passthrough in QEMU/KVM (linux) guest machine - Unix & Linux Stack Exchange

  * https://bugs.launchpad.net/qemu/+bug/1377163/
    Bug #1377163 “Does not add usb-host devices as they are hotplugg...” : Bugs : QEMU

  * https://bugzilla.redhat.com/show_bug.cgi?id=955438
    955438 – qemu should fail to boot guest when speed mismatch trying to attach low speed usb device to xHCI high speed controller

  * https://bugs.launchpad.net/qemu/+bug/1550743
    Bug #1550743 “connect low speed host devices to qemu ehci does n...” : Bugs : QEMU

  * https://bugzilla.redhat.com/show_bug.cgi?id=949505
    949505 – Assign 3.0 usb device to ehci and uhci or usb hub got applied anyway with warning but fails to function

  * https://www.reddit.com/r/linuxadmin/comments/7a7bgl/when_adding_usb_redirection_in_a_vm_it_resets_the/
    When adding USB redirection in a vm it resets the USB device and errors with speed mismatch. Any idea how to change speed? : linuxadmin

  * https://bugs.launchpad.net/qemu/+bug/1810000
    qemu system emulator crashed when using xhci usb controller

## Manually resizing an image

Nowadays this can be done with `kvmx growpart <device> <partition> <additional_size>`, but
here goes some manual procedures if needed.

* Image resize action, doing something like this, thanks to
  https://ahelpme.com/linux/online-resize-of-a-root-ext4-file-system-increase-the-space/

    # poweroff
    kvmx poweroff $guest

    # resize image
    qemu-img resize `kvmx list_image $guest` +5G

    # power up
    kvmx up $guest

    # ensure parted is installed
    #sudo apt-get install -y parted
    kvmx ssh $guest sudo apt-get install -y cloud-guest-utils

    # resize virtual machine root fs - while the partition is mounted!
    # this parted command currently need to be done manually
    #echo resizepart 2 -1 | kvmx ssh $guest sudo parted /dev/vda

    # See https://unix.stackexchange.com/questions/373063/auto-expand-last-partition-to-use-all-unallocated-space-using-parted-in-batch-m
    #     https://unix.stackexchange.com/questions/190317/gnu-parted-resizepart-in-script#202872
    #     https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203
    #     https://techtitbits.com/2018/12/using-parteds-resizepart-non-interactively-on-a-busy-partition/
    #     https://serverfault.com/questions/870594/resize-partition-to-maximum-using-parted-in-non-interactive-mode
    #kvmx ssh $guest sudo parted /dev/vda resizepart 2 -1 Yes
    kvmx ssh $guest sudo growpart /dev/vda 2

    kvmx ssh $guest sudo resize2fs /dev/vda2
    kvmx ssh $guest sudo touch /forcefsck
    kvmx restart $guest