USB mouse/keyboard usage without attaching it to dom0. it works but

I tried attaching usb mouse to a vm by attaching it to the vm. It works. But only problem is cursor is not visible. How can it be solved. I think this would keep usb mouse or keboard away from dom0?

anways around it? the mouse works inside the attached vm but the cursor is not visible. how to solve it?

What kind of VM is it? (AppVM or StandaloneVM with an custom image)

I ask because if you try this in a StandaloneVM in Full screen mode with a standard GNU/Linux distribution installed or Windows (over an .iso or simlar) and with a graphical user interface, it should work.

But if you try this with the standard AppVM it will not work without further action because the Qubes GUI Protocol (I hope it is called that) which is responsible for displaying the windows of the AppVMs in Dom0 is not designed to transfer the cursor as well.

It does not display in any kind of VM be it appvm or standalone or disposable vm. In all of these vms it works, performs all function like right click, left click scroll and all but the cursor remains invisible.

However all the vms i created were debian based, will it work in fedora based templates, not tried that yet.

yes, but are those VMs from the templates or self-installed systems in which you have a direct desktop view?

If they are VMs in which you ONLY see the windows of the individual programs, it works graphically via the Qubes GUI protocol which does not display the mouse cursor.

these vms are the one i created, like you create one in qubes. Not the already present ones. yes these are the qubes where you see windows of the individual program. like say you create a wube and it comes with few app installed already. and when you open lets a terminal a new window opens. Thats the qube where mouse cursor is not displayed but the mouse retains all the functionality. what can be done

I don’t know how exactly the Qubes GUI protocol works but my guess is that it can’t transmit the cursor at all.

But what you can try, but only possibly helps, is to assign a Theme to the cursor that theoretically should be displayed in the VM.

Run this in the VM (if it is an xfce VM):
xfconf-query -c xsettings -p /Gtk/CursorThemeName -s 'Adwaita'

However, I also don’t know whether the Adwaita theme is included in the VM-Templates at all.

I don’t know why you need the mouse in the VM, but in general it is better to use PS/2 input devices in QubesOS. You can also selectively say that e.g. only the mouse is forwarded to Dom0 from sys-usb after confirmation.

To search for available cursor themes in the debian based system, Run the following command:

apt-cache search xcursor

The cursor themes are typically provided by packages that start with xcursor-*.

The command will list packages related to cursor themes. Look for packages that include themes, like xcursor-*.

To apply the theme run the command by opening the xxfce terminal in the vm

Run this in the VM (if it is an xfce VM):

xfconf-query -c xsettings -p /Gtk/CursorThemeName -s 'themename'

running this command will not return anything. to check if this command has run successfully and the theme is applied run the following command as it is

xfconf-query -c xsettings -p /Gtk/CursorThemeName

This will output the current theme applied to the cursor.

Yet to try after applying the theme, if mouse cursor becomes visible.

Even after applying the theme, the cursor is not displayed in the vm. will the vm have to be restarted for it to take effect or just restarting the application should do?

yes but what if you dont have that option and only option is usb mouse. passing it to dom0 through sys-usb still has some risks. if attaching mouse directly to the vm is made to work, which for most of the part it works. just that cursor does not appear. it will be much safer.

I have now read more about it and have gathered information that confirms my first theory.

If a cursor is passed directly into the VM (e.g. via USB passthrough), it is rendered within the VM and the VM recognizes its position and can react to it. However, the Qubes GUI protocol only transmits the window contents to the Dom0, not the cursor itself.

The windows themselves are not cut out and transferred, but the protocol ensures that only the pixel data of the application windows (running in the VMs) is sent to Dom0.

It is not the same but comparable with X11 forwarding e.g. via ssh.

Theoretically yes, theoretically a virus in the sys-usb can see the data stream of the passthrough of the USB mouse to Dom0 and modefy it.

But first you have to get this particular virus into the VM. Since the VM is offline, or at least should be, the virus can only get there via other USB devices, as long as the templates are not affected, which would then also compromise all other VMs with the same templates. So it would have to be a specially developed virus which is unlikely and then someone with malicious intent needed physical access to your PC, I can’t estimate this probability but I also think it’s unlikely.

I’m trying to say whether it’s worth the effort for such a possibility, but I’m not in your environment so I can’t judge.

In addition, you want to use the mouse for something, so also in the VMs in which the data you want to protect is (if I’m right). so from the moment you forward the mouse to these VMs, it’s a risk anyways.

I’ve been having the same issue, I also want to use a appVM with mouse and keyboard attached using USB.

I don’t think you are missing the cursor theme, you can check with update-alternatives --config x-cursor-theme

I think the problem is the qubes input driver used by X11, but if you try and change the input drivers to the normal kbd and input/mice then qubes-gui stops working.