Easiest way to redirect USB to a VM?

70 views
Skip to first unread message

Guerlan

unread,
Oct 7, 2019, 1:04:05 AM10/7/19
to qubes-users
I tried to create sys-usb, and my keyboard stopped working. I then rebooted and couldn t use keyboard to put my LUKS password. I had to reinstall qubes entirely.

Is there an easier way to pass USB from dom0 to a VM? I don' t want to create a sys-usb and I don' t care too much about security in this level. I just need to have my Android phone inside the virtual machine.

Mike Keehan

unread,
Oct 7, 2019, 8:06:50 AM10/7/19
to qubes...@googlegroups.com
Have you read the docs? https://www.qubes-os.org/doc/usb-devices/

Guerlan

unread,
Oct 8, 2019, 2:40:23 PM10/8/19
to qubes-users
Yes, I followed that topic and when I created the sys-usb VM mey keyboard and mouse got disabled and I couldn't do anything else.

That's why I asked if there's an easier (possibly less secure) way to redirect the USB from dom0 directly to another VM. I can't create a sys-usb because I will be left without keyboard

Mike Keehan

unread,
Oct 8, 2019, 4:39:35 PM10/8/19
to qubes...@googlegroups.com
On Tue, 8 Oct 2019 11:40:23 -0700 (PDT)
Guerlan <worm...@gmail.com> wrote:

> Yes, I followed that topic and when I created the sys-usb VM mey
> keyboard and mouse got disabled and I couldn't do anything else.
>
> That's why I asked if there's an easier (possibly less secure) way to
> redirect the USB from dom0 directly to another VM. I can't create a
> sys-usb because I will be left without keyboard
>
> On Monday, October 7, 2019 at 9:06:50 AM UTC-3, Mike Keehan wrote:
> >
> > On Sun, 6 Oct 2019 22:04:05 -0700 (PDT)
> > Guerlan <worm...@gmail.com <javascript:>> wrote:
> >
> > > I tried to create sys-usb, and my keyboard stopped working. I
> > > then rebooted and couldn t use keyboard to put my LUKS password.
> > > I had to reinstall qubes entirely.
> > >
> > > Is there an easier way to pass USB from dom0 to a VM? I don' t
> > > want to create a sys-usb and I don' t care too much about
> > > security in this level. I just need to have my Android phone
> > > inside the virtual machine.
> > >

> >
> > Have you read the docs? https://www.qubes-os.org/doc/usb-devices/
> >
>

In the link above, the section titled "With The Command Line Tool" shows
how to use qvm-usb in dom0 to attach usb devices to a VM.

(I think you have been reading the usb-qubes page, and not that in the
link given above!).

Mike.

ps - mailing list etiquette is to post replies below the email, not
above.

Guerlan

unread,
Oct 8, 2019, 4:44:25 PM10/8/19
to qubes-users
I tried that too, but when I run qvm-usb I get an empty list of usb devices. Running lsusb obviously gives me a lot of usb devices (on dom0). So I thought sys-usb is needed for USB to work. What am I doing wrong?

Steve Coleman

unread,
Oct 8, 2019, 5:14:39 PM10/8/19
to qubes-users
On 2019-10-08 16:44, Guerlan wrote:
> I tried that too, but when I run qvm-usb I get an empty list of usb
> devices. Running lsusb obviously gives me a lot of usb devices (on
> dom0). So I thought sys-usb is needed for USB to work. What am I doing
> wrong?

I think the trick is to:

1) Make sure your Android device presents itself as a USB drive, so that
you can copy/move files between the device and the VM.

Q: Have you used the phone with any other Linux/Windows machine such
that you know it is configured to present the USB drive interface? I'm
pretty sure you need to configure that on the phone first.

2) Then Dom0 needs to have the proper tools/drivers to see that USB
device as a drive, so that it can be passed/attached via the command
line tools or the toolbar applet. I know that fedora-25 has a
"android-tools" package that might be needed for this.

Once you can see it in dom0 using qvm-usb/qvm-block you should be able
to pass it through to your VM with the toolbar applet or qvm-block attach.

Its been a long while since I have done this, and I have not yet done it
with either Qubes4.x nor my current Android phone, so your mileage may
vary greatly.




Guerlan

unread,
Oct 8, 2019, 5:35:48 PM10/8/19
to qubes-users
On Ubuntu it always worked out of th ebox,I only had to choose the rigth USB option in Android.

How can I install things in dom0? Is it posible?

I tried all USB modes on 2 phones and I get nothing on both qvm-usb and qvm-block

I also plugged an Yubikey and it appears in lsusb (the phones appear too) but they don't appear in the devices tray icon.

Steve Coleman

unread,
Oct 8, 2019, 5:44:22 PM10/8/19
to qubes-users
On 2019-10-08 17:35, Guerlan wrote:
> On Ubuntu it always worked out of th ebox,I only had to choose the rigth
> USB option in Android.
>
> How can I install things in dom0? Is it posible?

To search what is available:

dom0$ sudo qubes-dom0-update --action=search <string-to-search-for>

then:

dom0$ sudo qubes-dom0-update <package-name>

Be careful not to install any dangerous software that you don't actually
need in dom0. Its best to leave that to the VM's that will be mounting
the phone USB.
> --
> You received this message because you are subscribed to the Google
> Groups "qubes-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to qubes-users...@googlegroups.com
> <mailto:qubes-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/qubes-users/cbbed5fa-400a-44e6-8efc-832a5157af76%40googlegroups.com
> <https://groups.google.com/d/msgid/qubes-users/cbbed5fa-400a-44e6-8efc-832a5157af76%40googlegroups.com?utm_medium=email&utm_source=footer>.

Guerlan

unread,
Oct 8, 2019, 9:00:23 PM10/8/19
to qubes-users
I installed android-tools and it didn't work.

Are you sure I don't need a sys-usb VM?

awokd

unread,
Oct 8, 2019, 11:06:09 PM10/8/19
to qubes...@googlegroups.com
Guerlan:
> I installed android-tools and it didn't work.
>
> Are you sure I don't need a sys-usb VM?
If you want to try, in that same link that was posted earlier
(https://www.qubes-os.org/doc/usb-qubes/), look for the part about how
to create one manually. Pay close attention to how to identify a free
USB controller. Some machines only have one, in which case it is not an
option unless you have a PS/2 keyboard.

--
- don't top post
Mailing list etiquette:
- trim quoted reply to only relevant portions
- when possible, copy and paste text instead of screenshots

Jackie

unread,
Oct 9, 2019, 3:05:16 AM10/9/19
to qubes...@googlegroups.com
'awokd' via qubes-users:
> Guerlan:
>> I installed android-tools and it didn't work.
>>
>> Are you sure I don't need a sys-usb VM?
> If you want to try, in that same link that was posted earlier
> (https://www.qubes-os.org/doc/usb-qubes/), look for the part about how
> to create one manually. Pay close attention to how to identify a free
> USB controller. Some machines only have one, in which case it is not an
> option unless you have a PS/2 keyboard.

I haven't done this but according to the docs it's possible to create
sys-usb even if you depend on a usb keyboard to enter luks passphrase.
See the "enable a usb keyboard for login" section of the doc page.

I think you do need a sys-usb for what you're trying to do though. USB
keyboard/mouse and block devices work, but i was never able to get other
kinds of usb devices working without sys-usb. (I think because dom0
lacks the needed drivers for them - so it might be possible to install
the required drivers in dom0 instead? That would present a security risk
though.)

Beto HydroxyButyrate

unread,
Oct 10, 2019, 3:38:03 AM10/10/19
to qubes-users


On Wednesday, October 9, 2019 at 5:05:16 PM UTC+10, Jackie wrote:
'awokd' via qubes-users:

> to create one manually. Pay close attention to how to identify a free
> USB controller. Some machines only have one, in which case it is not an
> option unless you have a PS/2 keyboard.

I haven't done this but according to the docs it's possible to create
sys-usb even if you depend on a usb keyboard to enter luks passphrase.
See the "enable a usb keyboard for login" section of the doc page.


I have done this. Namely, installed without sys-usb, and then much later decided I need it, and went thru some steps to enable it.
I have only one USB controller and a USB keyboard and mouse and enter the LUKS password at boot.
I did backup everything prior to doing so, but there were no drama.

What doesn't work for me is using the GUI to assign USB devices to a VM.
I have to go into dom0 and do `qvm-usb; qvm-usb attach ...`.
The GUI presents the list of USB devices, and the list of potential VMs to attach to,
but never works to select the VM to attach to.  No error.  Silent failure.

Been meaning to open a defect for this, but it is not something I do often.

Guerlan

unread,
Oct 10, 2019, 12:45:13 PM10/10/19
to qubes-users
after reading carefully I found the option to automatically add the keyboard and create the sys-usb vm
Reply all
Reply to author
Forward
0 new messages