15

I am running Ubuntu 16.04 on the Windows Subsystem for Linux on Windows 10 (with the Creators update). I have an X server (VcXsrv) running in Windows and from bash I open an lxterminal on that X server. My laptop has a resolution of 3840x2160 pixels.

My problem is that the mouse pointer in the lxterminal window is so small I can not find it even if I move it, so I have to move it out of the terminal window and then carefully move it to the place I want it to be.

This setup is so unusual (yet!) that I haven't found anything by searching.

How can I make the mouse pointer bigger?

Peter Jaric
  • 2,076
  • 5
  • 28
  • 37
  • Not sure how it works under VcXsrv in Windows 10, but on Linux, the X server uses a "cursor font" from which it selects the cursors. You can select the cursor font as command line argument `-fc` when you start the X server. See `man Xserver`. It's not possible to set just the size of the cursor. – dirkt Apr 08 '17 at 16:20
  • And maybe [this](http://www.ru.j-npcs.org/usoft/WWW/HOWTO/mini/X-Big-Cursor) helps, if you don't have alternate cursor fonts installed already. – dirkt Apr 08 '17 at 16:22
  • @dirkt Thanks! I'm experimenting with this right now, but I'm at a loss on the format of the argument to -fc. Should it be the font name, the path to the font name, including the extension, etc? The big search engine didn't turn up anything useful. – Peter Jaric Apr 10 '17 at 10:54
  • Good question, I don't know. I'd assume "font name" (`-fp` is the search path for fonts, and there are also font servers, which are separate programs). Give it a try and watch `Xorg.log` (whereever that is in Windows 10) to find out what happens – dirkt Apr 10 '17 at 11:07
  • I found out how to add the font and reference it. There's a file called fonts.dir in each font folder, and in the one with my new cursor font (created with bdfresize) I added ```cursor2.pcf.gz cursor2``` and then I could reference it with ```-fc cursor2``` with no error messages. It didn't help though, the cursor is unchanged. – Peter Jaric Apr 10 '17 at 15:53
  • I could have told you about `fonts.dir`. :-) What does `Xorg.log` say when you use `-fc cursor2`? Does the font show up with `xlsfonts`? – dirkt Apr 10 '17 at 16:08
  • Yes, ```xlsfonts -ll cursor2``` works, and it has double the POINT_SIZE compared to "cursor". – Peter Jaric Apr 12 '17 at 07:44
  • The log (sans ips and paths): ```(II) AIGLX: enabled GLX_SGI_make_current_read (II) AIGLX: enabled GLX_MESA_copy_sub_buffer (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control (II) AIGLX: enabled GLX_SGIX_pbuffer (II) AIGLX: enabled GLX_ARB_multisample and GLX_SGIS_multisample (II) 80 pixel formats reported by wglGetPixelFormatAttribivARB (II) AIGLX: Set GLX version to 1.4 (II) GLX: Initialized Win32 native WGL GL provider for screen 0 winBlockHandler - pthread_mutex_unlock() winClipboardThreadProc - DISPLAY=127.0.0.1:0.0``` – Peter Jaric Apr 12 '17 at 07:44
  • Partial success! It turns out that when I right-click in my terminal, the cursor changes shape - and is much bigger! So the cursor actually is changed, but not when it is a text caret (ⵊ), in lxerminal, emacs or xterm. Thanks for the help! – Peter Jaric Apr 12 '17 at 08:19
  • I think that the text caret depends on the font size, so try to use larger fonts (e.g. `xterm -fn font_name`) and see what happens. Also, please write up what you've done as an answer, so the next person with the same problem has it easier. – dirkt Apr 12 '17 at 09:19
  • Hm, I just checked with `xfd -fn cursor`, and the text caret cursor icon is the last char in the font. Did it change size when you converted the font? – dirkt Apr 12 '17 at 09:23
  • I spoke to soon. I can not reproduce my previous results. But checking with xfd confirms that the cursor font has been resized, at least. – Peter Jaric Apr 18 '17 at 11:35
  • 1
    It's an annoying issue. As far as I can tell its not related to the windows-linux-subsystem but just to VcXsrv. I'm having this issue with all xclients independently on where they are running. – Reto Gmür May 30 '17 at 15:21
  • @RetoGmür Thanks for the insight - that would make it easier to debug. As far as I understand it VcXsrv is the best option generally, but maybe I should try another X server (not XMing though - it has some other issue that made me change to VcXsrv). – Peter Jaric May 31 '17 at 07:41

4 Answers4

12

The following works, though might not be the best solution. Install package big-cursor

sudo apt-get install big-cursor

Then go to the directory you installed VcXsrv in, to the directory fonts/misc (e.g C:\Program Files\VcXsrv\fonts\misc), rename the file cursor.pcf.gz to cursor-small.pcf.gz, and then copy, from the linux system, /usr/share/fonts/X11/misc/big-cursor.pcf.gz to cursor.pcf.gz in the fonts/misc directory on the Windows side (where VcXsrv resides)

I'm sure there is a more elegant way to do this, but on my machine it works.

4

Set cursor size with this variable:

export XCURSOR_SIZE=64

Run this command in linux terminal. Choose suitable size: 16, 32, 64. To persist this settings between terminal sessions, add this command in ~/.bashrc.

I've tested this solution with VcXsrv and X410 X-Servers.

andrew
  • 141
  • 2
  • 1
    Didn't work for me. Tried starting VcXsrv from within LSW bash shell, and tried starting from within windows with that set in the environment. The big-cursor method above worked. – KevinButler Jan 22 '20 at 19:39
  • When I try this, the cursor does increase in size, but it seems the "window" it has to be visible stays the same - so it's now larger but the bottom half of it is cut off. – Tyler Shellberg Mar 10 '20 at 20:52
  • Worked for me on Cygwin/X + Putty to *decrease* cursor size (32 was the right one for me). – yvf Jun 27 '20 at 22:23
2

I didn't like the accepted answer because big-cursor is pretty ugly actually, and I want something that's a bit nicer (and possibly larger). I couldn't find any cursors in the .pcf.gz format, so I tried looking for another solution.

Anyway, it turns out that that you don't need to do this at all. With the current version of VcXsrv, you can just install any cursor theme in Linux and if you set it up right, VcXsrv will use it. I think the tiny black cursor is there only as a fallback, but I really have no idea. Anyway, here's how I did it.

My setup was Windows 10, VcXsrv 1.20.14.0, Ubuntu 20.04, WSL2. It should work on other distros and in other configurations, though, since I was using generic X11 stuff. I'm not a Linux expert, though.

First, install this package:

sudo apt install x11-xserver-utils

Create an ~/.Xresources file with the contents:

Xcursor.theme: default
Xcursor.size: 48

Then run:

xrdb -load ~/.Xresources

Restart the X11 server and then start a GUI application (I'm assuming the DISPLAY is set up already). The cursor should change. You can fiddle with the size field to make it larger.

If this doesn't work, I think it's possible you don't have themes installed.

I wanted to install a different cursor theme since I didn't like the default ones anyway, so here's how I did that.

I chose https://github.com/manu-mannattil/adwaita-cursors, downloaded, and unpacked:

wget https://github.com/manu-mannattil/adwaita-cursors/releases/download/v1.2/adwaita-cursors.tar.gz
tar -xvzf adwaita-cursors.tar.gz

In general, you should be able to unpack the cursor theme to ~/.icons, or according to other sources ~/.local/share/icons. I didn't have any luck with that, no idea why.

Instead, I had to unpack it to what looks like the root folder for icon themes, /usr/share/icons.

sudo mv adwaita-cursors/Adwaita /usr/share/icons/adwaita

The directory structure of the theme needs to be THEME_NAME/cursors, so make sure whatever you're unpacking has that format.

After you're done with that, modify the .Xresources file you created earlier to use the THEME_NAME from before (in my case, adwaita):

Xcursor.theme: THEME_NAME
Xcursor.size: 48

Then run this again:

xrdb -load ~/.Xresources

Restart your GUI application (and maybe the X11 server), and there ya go.

GregRos
  • 148
  • 1
  • 6
1

Setting the option -swcursor for VcXsrv worked for me.

Update for "VcXsrv X Server" 1.20.8.1 (7 Apr 2020) to answer one of the comments. Client side is Putty session with X11 forwarding. Tested on VSCode (code) window on Manjaro with XFCE installed (Current Manjaro Linux as of April 19, 2020). Full XFCE is not running, just VSCode window.

Under additional settings in VcXsrv add this parameter:

-swcursor

how to set -swcursor option

The configuration is most likely specific to just "Multiple windows" mode:

enter image description here

with "Start no Client" option:

enter image description here

Sergei G
  • 113
  • 4
Bassam
  • 39
  • 2
  • 2
    While this may answer the question, it would be a better answer if you could provide some explanation **how** to change that setting. – DavidPostill Mar 15 '18 at 12:33
  • 1
    This did not work for me (I added the option in my shortcut to vcxsrv.exe). The only difference I noticed was that the pointer was much slower and lagged. – Peter Jaric Mar 19 '18 at 12:15
  • This also worked on Xming for me. I modified the "Target" property on the Xming shortcut and added "-dpi 100 -swcursor" to increase both font and mouse cursor size. – Abid H. Mujtaba Mar 31 '20 at 16:41