Welcome to the Linux Foundation Forum!

LFS201 - Chapter 27 Discussion // Questions // Banter - Devices and udev

Lab 27.1: we need to be able to connect a USB device so we can validate the rules we create. I'm not sure how I can do this on a GCP virtual environment.

I've looked at two potential options but I'm not sure if either provides precisely what I'm looking for.

https://github.com/martinpitt/umockdev
uMockDev provides a way to capture a devices connection event data and replay it in a sandboxed environment.
Because the mock connection is in a sandboxed (testbed) environment it may not pickup the rules set in /usr/lib/udev/rules.d or /etc/udev/rules.d/

https://www.qemu.org/docs/master/system/usb.html
I think this option relies on a complete QEMU system which is far more than what's necessary for this exercise.

Does anyone else have experience with this?

Any alternatives or advice is greatly appreciated.

Comments

  • coopcoop Posts: 680

    Your stretching things pretty far. LFS201 was designed to be run either on a physical machine or a VM with a full GUI, like Virtual Box or VMware or KVM. It's hardware requirements are very modest. While we did give instructions about running on the AWS vfree tier, we did warn not everything could be done, and the same things should be true in GCP. Because it is being used in the bootcamp path, we are getting a different set of students more interested in these kinds of experiments!

    Even in a simple local VM, this exercise can be a pain in the you know what because it depends on the ability to pass through the USB device properly to the guest system. When people are running Windows or a Mac etc, you wind up getting into questions that are really ones of the OS and its device drivers and the hypervisor, neither one of which is an object for discussion much in LFS201.

    So you might find this a fun learning exercise but the udev part of it is likely to be rather small and artificial. I would make sure I knew how to do it on a real physical system before I attempt to do it in an unreal one.

    We run into similar things when we teach performance tuning. While you can do the same exercises in these environments what you wind up studying is the fake counters etc that the hypervisor or cloud environment is pretending with and it really doesn't teach you how to tune anything -- unless the course is one on tuning hypervisors or cloud environments, in which case you need a different set of exercises.

    Just my perspective. I'm sure some students are intrigued by what you are proposing and I hope you find what you are looking for.

  • GRO 108GRO 108 Posts: 46

    Thanks @coop .
    I had similar thoughts re: cost/benefit running through my head when I was searching for a solution. For now I'm going focus on the topic but it is good to know there are these tools available.

Sign In or Register to comment.