- Newest
- Most votes
- Most comments
So, I got an answer to this question from someone at AWS Support team. Hope this answer helps someone else in need.
You reached out to AWS Support, because you are looking to use usbip client on AWS EC2 instances, but found no required kernel modules (usbip-core, vhci-hcd) available on Ubuntu[18|20] AMIs. You would like our assistance to address this and find the way to have usbip working on AWS EC2 instances.
In my test environment in us-east-1 AWS Region, I launched test EC2 instances from the latest AMIs for Amazon Linux 2 (ami-0be2609ba883822ec), and Ubuntu 20.04 (ami-0885b1f6bd170450c).
I found that Amazon Linux 2 has required drivers:
uname -r
4.14.209-160.339.amzn2.x86_64
modinfo vhci_hcd usbip_core | grep filename
filename: /lib/modules/4.14.209-160.339.amzn2.x86_64/kernel/drivers/usb/usbip/vhci-hcd.ko
filename: /lib/modules/4.14.209-160.339.amzn2.x86_64/kernel/drivers/usb/usbip/usbip-core.ko
But, I didn't find usbip userspace tools after enabled EPEL repository[1], and scanned for package which may have this binary:
yum provides */usbip | grep bin
And proceeded with installation of it from a tarball I sourceforge[2]:
yum install autoconf libtool libsysfs-devel glib*
wget https://downloads.sourceforge.net/project/usbip/usbip/0.1.7/usbip-0.1.7.tar.gz
tar -xzf usbip-0.1.7.tar.gz
cd usbip-0.1.7/src
./autogen.sh
./configure
make install
By default it's installed in /usr/local/bin which can be added to PATH with profile:
echo "export PATH=$PATH:/usr/local/bin" > /etc/profile.d/path.sh && source /etc/profile.d/path.sh
usbip --help
For Ubuntu 20.04, I found that the drivers are available in "linux-image-extra-virtual" and I have it installed with 5.4.0-58-generic kernel:
uname -r
5.4.0-1029-aws
apt update
apt install linux-image-extra-virtual
find /usr/ -iname "vhci*"
/usr/lib/modules/5.4.0-58-generic/kernel/drivers/usb/usbip/vhci-hcd.ko
..
find /usr/ -iname "usbip*"
/usr/lib/modules/5.4.0-58-generic/kernel/drivers/usb/usbip
/usr/lib/modules/5.4.0-58-generic/kernel/drivers/usb/usbip/usbip-core.ko
/usr/lib/modules/5.4.0-58-generic/kernel/drivers/usb/usbip/usbip-vudc.ko
/usr/lib/modules/5.4.0-58-generic/kernel/drivers/usb/usbip/usbip-host.ko
..
Added drivers to load on boot:
echo "vhci_hcd" >> /etc/modules-load.d/modules.conf
echo "usbip_core" >> /etc/modules-load.d/modules.conf
Then installed usbip:
apt install linux-tools-5.4.0-58-generic
Then modified grub to boot with 5.4.0-58-generic instead of 5.4.0-1029-aws according to $menuentry_id_option in my /boot/grub/grub.cfg
grep -A1000 submenu /boot/grub/grub.cfg |grep menuentry
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-175c087c-0fe9-4d62-a38d-e5f8a66a5851' {
..
menuentry 'Ubuntu, with Linux 5.4.0-58-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-58-generic-advanced-175c087c-0fe9-4d62-a38d-e5f8a66a5851' {
..
vim /etc/default/grub
#GRUB_DEFAULT=0
GRUB_DEFAULT="gnulinux-advanced-175c087c-0fe9-4d62-a38d-e5f8a66a5851>gnulinux-5.4.0-58-generic-advanced-175c087c-0fe9-4d62-a38d-e5f8a66a5851"
Then updated grub, rebooted ec2 instance, and verified usbip and loaded modules:
update-grub && reboot
uname -r
5.4.0-58-generic
lsmod | grep vhci
vhci_hcd 53248 0
usbip_core 36864 1 vhci_hcd
usbip --help
Edited by: TValley on Dec 31, 2020 12:51 AM
Relevant content
- asked 8 months ago
- asked a year ago
- Accepted Answerasked 5 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago