OpenBSD Amsterdam Logo
433 VMs deployed 🐡

Using mosh (Mobile Shell)

SSH waits for the server's reply before showing you your own typing. That can make for a lousy user interface. Mosh is different: it gives an instant response to typing, deleting, and line editing. It does this adaptively and works even in full-screen programs like emacs and vim. On a bad connection, outstanding predictions are underlined so you won't be misled.

With mosh you can get rid of network lag.

On your VM install mosh with:

# pkg_add mosh
...

On the machine you are connecting from you also need mosh which you can download here. When you connect to your VM with:

$ mosh <your_vm>

And you are greeted with an error like:

mosh-server needs a UTF-8 native locale to run.

Unfortunately, the local environment ([no charset variables]) specifies
the character set "US-ASCII",

The client-supplied environment ([no charset variables]) specifies
the character set "US-ASCII".

LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
Connection closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

Make sure you add something like the following to your .profile:

export LC_CTYPE='en_US.UTF-8'