4

After installing Bash on Ubuntu on Windows, I'm receiving an error from any rlwrap command.

root@localhost:~# rlwrap ls
rlwrap: Could not open master pty: No such file or directory

I've made sure that /dev/ptmx has the correct permissions

root@localhost:~# ls -ld /dev/ptmx
crw-rw-rw- 1 root tty 5, 2 Apr  9 22:44 /dev/ptmx

Yet I still can't get it working. Am I the only one encountering this error? Any help would be greatly appreciated.

Hans Lub
  • 5,513
  • 1
  • 23
  • 43
puradox
  • 1,358
  • 1
  • 12
  • 13

2 Answers2

4

Windows Subsystem for Linux (WSL) doesn't (yet?) have a working pty implementation. I suspect that opening /dev/ptmx always fails for this reason, even though the device file exists and has the right permissions.

rlwrap, but also programs like screen and tmux, are never going to work without a pty device. They fail under WSL for the same reason as rlwrap.

Hans (rlwrap maintainer)

Hans Lub
  • 5,513
  • 1
  • 23
  • 43
0

I just had the same issue on my Ubuntu 16.04. Purging and re-installing rlwrap solved the problem for me.

sudo apt-get purge rlwrap
sudo apt-get install rlwrap

Of course this is a bit of a different issue because it's not exactly WSL.

Jörgen Brandt
  • 210
  • 2
  • 9
  • As you say, your problem was with Ubuntu on Linux, not with Windows: a completely different issue. Most probably caused by [incorrect permissions](http://stackoverflow.com/questions/3886629/rlwrap-could-not-open-master-pty-no-such-file-or-directory) on /dev/ptmx – Hans Lub May 12 '16 at 08:49
  • Sry, I forgot to mention that I was aware of that post and that the permissions were set correctly when I ran into the problem. That WSL is not exactly the same as native Ubuntu is, of course, correct. – Jörgen Brandt May 14 '16 at 05:01
  • No need to say sorry! But whoever has this problem on _linux_ (with correct permissions for `/dev/ptmx`), please [file a bug report](https://github.com/hanslub42/rlwrap/issues) – Hans Lub May 14 '16 at 07:50