0

I have an Ubuntu Server 18.04. I setup a VNC connection - that is to say, I installed GNOME, which has a graphical interface. I connected through SSH, start vncserver and then connect to VNC.

When I open the terminal I have the following error:

There was an error creating the child process for this terminal. Failed to open PTY: Permission denied.

How can I solve this?

Output of cat /proc/sys/kernel/pty/max /proc/sys/kernel/pty/nr is

4096
2
4
0

For me, running the following command fixed the terminal:

sudo chmod 666 /dev/pts/ptmx
2
  • 2
    Where did you get this from? Why does fixed terminal stand at the end of the line? What does it mean? What does it do?
    – Levente
    May 16 at 12:51
  • 1
    @Levente fixed terminal was not a command argument. It was mistakenly formatted as code by an editor. I don't blame the editor though, as the OP hadn't used code formatting, and by the way the command was written, it was easy to be mistaken for being part of the command. Jun 15 at 16:27
0

It may be because ptsfs isn't running.

Check ptsfs is running by

mount | grep pts

You should see something like this

devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)

If ptsfs isn't running then mount it manually, as root

$ sudo mount -t devpts devpts /dev/pts

and add the following line to /etc/fstab

devpts           /dev/pts              devpts  gid=5,mode=620  0 0

The reasoning behind this answer is explained here, gnome-terminal: There Was An Error Creating The Child Process For This Terminal,

This problem is related to devpts (also known as Unix98 pty naming) file system. The devpts must be mounted on /dev/pts. Before opening the pseudo-terminal slave, you or the process must pass the master’s file descriptor. From the man page:

minor number 2, usually of mode 0666 and owner.group of root.root. It
is used to create a pseudo-terminal master and slave pair. When a
process opens /dev/ptmx, it gets a file descriptor for a
pseudo-terminal master (PTM), and a pseudo-terminal slave (PTS) device
is created in the /dev/pts directory. 


FWIW, the above "gnome-terminal" link was linked to from an unrelated gnome-terminal bug logged on the Mint bug database, There Was An Error Creating The Child Process For This Terminal, however, the error in that was subtly different:

There Was An Error Creating The Child Process For This Terminal
Text was empty or contained only white spaces

This issue also occurs on Ubuntu, as referenced here, on Ask Ubuntu, How do I relaunch terminal?.

The solution to which could be either

To solve the problem : Click the profile preferences box, untick "run a custom command". Exit. Close the terminal and relaunch. Thats it.

or the answer to How do I relaunch terminal?

However, as this is a different error from your issue, it should probably be discounted. I only mention it as it was how I found the gnome-terminal ptsfs issue/solution.

0

I had a similar problem, but I was suspicious that Docker was the culprit.

I rebooted my machine, and once at login, I hit Ctrl+Alt+F3 to switch to a console. I then stopped all running containers, removed all containers, removed all images, and rebooted.

The terminal started working again afterward, though I'm still getting weird crash reports for Xorg.

0

This is a top hit on search for this issue so putting in my experience.

In my case this issue just came up out of the blue. Per the other answers one can change the mode on the ptmx file to 666 and fix the issue until reboot. One can also add a mount command to fstab but be sure to include ,ptmxmode=666. That fixes the persistence. But why did this happen. I've NEVER had to add such a mount to my fstab. The other post above by @dwbailey was the clue. Turns out a running docker container (poorly formed I suppose) can mess with the ptsfs.

https://github.com/moby/moby/issues/19464

Just before this issue occured for me I had started a container with docker-compose to evaluate a project. That container was restarting at boot which explains why rebooting did not clear this issue, but once I brought it down this issue went away.

So tip is, if you recently started a container and this issue "just appeared out of no where" then it's most likely that container.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.