Skip to main content
deleted 1 character in body
Source Link
telcoM
  • 114.4k
  • 5
  • 163
  • 311

It looks like you're doing nested virtualization: you are running Linux in a VirtualBox VM, and trying to run another Qemu VM inside that VM - is that correct?

You should also specify the name and version of the Linux distribution you're using, or at least the version of Qemu you're using.

If you use -serial /dev/ttyUSB0, then the sensor should appear within the Qemu VM as a "real" serial device, i.e. as /dev/ttyS0 if the OS of the Qemu VM is Linux, or as COM1: if Windows.

If you want to give the serial converter (and thus the sensor) to the Qemu VM's control as a USB device, you will have to first have VirtualBox present it to your Linux VM. Since it's visible in the lsusb listing, you have already achieved that. The next step would be to disconnect the Linux VM's usbserial driver from the device. There are many ways to achieve that:

Unload the USB serial driver module responsible for the serial converter support:

sudo modprobe -r ch341

Or find the USB path specification for the serial converter, and tell the driver to unbind it. For example:

ls -l /sys/bus/usb-serial/devices/ttyUSB0
lrwxrwxrwx 1 root root 0 Dec  6 16:47 /sys/bus/usb-serial/devices/ttyUSB0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/ttyUSB0/

Here in my example, the USB path is 1-8:1.0. To unbind it:

echo -n "1-8:1.0" > sudo tee /sys/bus/usb/drivers/ch341/unbind

You must find the correct path for your system.

Once the USB-serial converter driver is out of the way, you'll need to ensure that Qemu has permission to access the "raw" USB device. If you are running the VM as user fedor:

 sudo chown -R fedor /procdev/bus/usb

After this, you should be able to start your Qemu VM and have it claim the USB-serial converter device for itself.

Note that your list of options specifes -usb twice, on lines #6 and #7. Perhaps just once would be enough?

Also, the Qemu USB emulation documentation for Qemu 4.2.50 says the USB -device option should be

-device usb-host,productid=0x1a86,vendorid=0x7523 \

instead of your

-device usb-host:productid=0x1a86,vendorid=0x7523 \

Note the comma instead of the colon. This might be the cause of your error message, or the syntax might vary in different versions of Qemu.

None of your three links mention your mkisofs command: it's still unclear to me what you wish to achieve with that.

It looks like you're doing nested virtualization: you are running Linux in a VirtualBox VM, and trying to run another Qemu VM inside that VM - is that correct?

You should also specify the name and version of the Linux distribution you're using, or at least the version of Qemu you're using.

If you use -serial /dev/ttyUSB0, then the sensor should appear within the Qemu VM as a "real" serial device, i.e. as /dev/ttyS0 if the OS of the Qemu VM is Linux, or as COM1: if Windows.

If you want to give the serial converter (and thus the sensor) to the Qemu VM's control as a USB device, you will have to first have VirtualBox present it to your Linux VM. Since it's visible in the lsusb listing, you have already achieved that. The next step would be to disconnect the Linux VM's usbserial driver from the device. There are many ways to achieve that:

Unload the USB serial driver module responsible for the serial converter support:

sudo modprobe -r ch341

Or find the USB path specification for the serial converter, and tell the driver to unbind it. For example:

ls -l /sys/bus/usb-serial/devices/ttyUSB0
lrwxrwxrwx 1 root root 0 Dec  6 16:47 /sys/bus/usb-serial/devices/ttyUSB0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/ttyUSB0/

Here in my example, the USB path is 1-8:1.0. To unbind it:

echo -n "1-8:1.0" > sudo tee /sys/bus/usb/drivers/ch341/unbind

You must find the correct path for your system.

Once the USB-serial converter driver is out of the way, you'll need to ensure that Qemu has permission to access the "raw" USB device. If you are running the VM as user fedor:

 sudo chown -R fedor /proc/bus/usb

After this, you should be able to start your Qemu VM and have it claim the USB-serial converter device for itself.

Note that your list of options specifes -usb twice, on lines #6 and #7. Perhaps just once would be enough?

Also, the Qemu USB emulation documentation for Qemu 4.2.50 says the USB -device option should be

-device usb-host,productid=0x1a86,vendorid=0x7523 \

instead of your

-device usb-host:productid=0x1a86,vendorid=0x7523 \

Note the comma instead of the colon. This might be the cause of your error message, or the syntax might vary in different versions of Qemu.

None of your three links mention your mkisofs command: it's still unclear to me what you wish to achieve with that.

It looks like you're doing nested virtualization: you are running Linux in a VirtualBox VM, and trying to run another Qemu VM inside that VM - is that correct?

You should also specify the name and version of the Linux distribution you're using, or at least the version of Qemu you're using.

If you use -serial /dev/ttyUSB0, then the sensor should appear within the Qemu VM as a "real" serial device, i.e. as /dev/ttyS0 if the OS of the Qemu VM is Linux, or as COM1: if Windows.

If you want to give the serial converter (and thus the sensor) to the Qemu VM's control as a USB device, you will have to first have VirtualBox present it to your Linux VM. Since it's visible in the lsusb listing, you have already achieved that. The next step would be to disconnect the Linux VM's usbserial driver from the device. There are many ways to achieve that:

Unload the USB serial driver module responsible for the serial converter support:

sudo modprobe -r ch341

Or find the USB path specification for the serial converter, and tell the driver to unbind it. For example:

ls -l /sys/bus/usb-serial/devices/ttyUSB0
lrwxrwxrwx 1 root root 0 Dec  6 16:47 /sys/bus/usb-serial/devices/ttyUSB0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/ttyUSB0/

Here in my example, the USB path is 1-8:1.0. To unbind it:

echo -n "1-8:1.0" > sudo tee /sys/bus/usb/drivers/ch341/unbind

You must find the correct path for your system.

Once the USB-serial converter driver is out of the way, you'll need to ensure that Qemu has permission to access the "raw" USB device. If you are running the VM as user fedor:

 sudo chown -R fedor /dev/bus/usb

After this, you should be able to start your Qemu VM and have it claim the USB-serial converter device for itself.

Note that your list of options specifes -usb twice, on lines #6 and #7. Perhaps just once would be enough?

Also, the Qemu USB emulation documentation for Qemu 4.2.50 says the USB -device option should be

-device usb-host,productid=0x1a86,vendorid=0x7523 \

instead of your

-device usb-host:productid=0x1a86,vendorid=0x7523 \

Note the comma instead of the colon. This might be the cause of your error message, or the syntax might vary in different versions of Qemu.

None of your three links mention your mkisofs command: it's still unclear to me what you wish to achieve with that.

Source Link
telcoM
  • 114.4k
  • 5
  • 163
  • 311

It looks like you're doing nested virtualization: you are running Linux in a VirtualBox VM, and trying to run another Qemu VM inside that VM - is that correct?

You should also specify the name and version of the Linux distribution you're using, or at least the version of Qemu you're using.

If you use -serial /dev/ttyUSB0, then the sensor should appear within the Qemu VM as a "real" serial device, i.e. as /dev/ttyS0 if the OS of the Qemu VM is Linux, or as COM1: if Windows.

If you want to give the serial converter (and thus the sensor) to the Qemu VM's control as a USB device, you will have to first have VirtualBox present it to your Linux VM. Since it's visible in the lsusb listing, you have already achieved that. The next step would be to disconnect the Linux VM's usbserial driver from the device. There are many ways to achieve that:

Unload the USB serial driver module responsible for the serial converter support:

sudo modprobe -r ch341

Or find the USB path specification for the serial converter, and tell the driver to unbind it. For example:

ls -l /sys/bus/usb-serial/devices/ttyUSB0
lrwxrwxrwx 1 root root 0 Dec  6 16:47 /sys/bus/usb-serial/devices/ttyUSB0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/ttyUSB0/

Here in my example, the USB path is 1-8:1.0. To unbind it:

echo -n "1-8:1.0" > sudo tee /sys/bus/usb/drivers/ch341/unbind

You must find the correct path for your system.

Once the USB-serial converter driver is out of the way, you'll need to ensure that Qemu has permission to access the "raw" USB device. If you are running the VM as user fedor:

 sudo chown -R fedor /proc/bus/usb

After this, you should be able to start your Qemu VM and have it claim the USB-serial converter device for itself.

Note that your list of options specifes -usb twice, on lines #6 and #7. Perhaps just once would be enough?

Also, the Qemu USB emulation documentation for Qemu 4.2.50 says the USB -device option should be

-device usb-host,productid=0x1a86,vendorid=0x7523 \

instead of your

-device usb-host:productid=0x1a86,vendorid=0x7523 \

Note the comma instead of the colon. This might be the cause of your error message, or the syntax might vary in different versions of Qemu.

None of your three links mention your mkisofs command: it's still unclear to me what you wish to achieve with that.