[GLLUG] Does any virtualisation system provide good support for USB device forwarding?

John Winters john at sinodun.org.uk
Wed Apr 9 10:12:25 UTC 2014


On 08/04/14 22:31, Philip Hands wrote:
[snip]
> As an additional data point, here's that way that DSA (the Debian
> SysAdmin team ... the folk that run the Debian infrastructure) set up
> VMs under KVM:
>
>    https://dsa.debian.org/howto/install-kvm/
>
> which is intended to be cut&pasted on the host.  (The stuff about kpartx
> at the end can be a helpful reminder of how to do that)

Thanks Phil - that's been very useful.

I found a couple of wrinkles in the scripts as presented there.  I don't 
know whether that page is being actively maintained, but...

In the setup_env part, if your vg name happens to contain a hyphen then 
the dev_root variable and friends don't get set up correctly.  I changed:

dev_root="/dev/mapper/$vg-$guest--root" &&

to

dev_root="/dev/mapper/${vg//-/--}-$guest--root" &&

to fix that.  Then in the install_base part I again hit a failure 
between the lines:

    kpartx -v -a "$dev_boot" &&
    mkfs."$fs" "$dev_boot"1

The script halted with the following error:

add map black--hdd-mythtv--boot1 (254:14): 0 256977 linear 
/dev/mapper/black--hdd-mythtv--boot 63
mke2fs 1.42.9 (4-Feb-2014)
Could not stat /dev/mapper/black--hdd-mythtv--boot1 --- No such file or 
directory

although on examination, the file did seem to be there and the mkfs 
command completed successfully when invoked manually.  It appears to be 
a problem with the file not being there yet when mkfs starts (is it 
created asynchronously?)

Anyway, I fixed that with:

    kpartx -v -a "$dev_boot" &&
    sleep 3 &&
    mkfs."$fs" "$dev_boot"1

which is a bit of a nasty cludge, but it seemed to work.  The bootstrap 
operation then seems to succeed.

I pass these back in case they're useful.

Cheers,
John




More information about the GLLUG mailing list