2

I am trying to run the Atom editor in Ubuntu 20.04 under Windows Subsystem for Linux.

I installed Ubuntu then Node.js. Both seem to work fine. Then I followed the instructions on this site for installing Atom.

When I then run atom, I get the following:

ro@PC:~$ atom
expr: syntax error: missing argument after ‘8’
ro@PC:~$ /usr/bin/atom: line 195:    89 Segmentation fault      nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1

This is what is in my ~/.atom folder:

ro@PC:~/.atom$ ll
total 8
drwxr-xr-x 2 ro ro 4096 Apr 25 09:52 ./
drwxr-xr-x 9 ro ro 4096 Apr 25 09:52 ../
-rw-r--r-- 1 ro ro    0 Apr 25 11:52 nohup.out

I have no idea what I am doing wrong as I am new to Linux.

NotTheDr01ds
  • 17,888

1 Answers1

3

I can confirm from installing and running Atom on my own WSL system that there are two problems that you are running into. The first one of these is fairly common, but the Atom error message is so different from other applications that I'm glad you've posted it so that others can find it when searching.

/usr/bin/atom: line 195:    89 Segmentation fault      nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1

That error is caused by your first issue. As mentioned in the comments, you are running WSL on Windows 10 without an X server.

WSL on Windows 10 does not support Linux GUI applications on its own. Linux GUI applications (traditionally) are X clients, which use the X11 protocol to communicate with an "X server" which handles the job of displaying them, translating your input (mouse, keyboard, etc.), and other tasks.

On Windows 10, WSL just doesn't (directly) support that functionality. There are really three possible solutions, and while I'll summarize them here, I'll point you to several other questions for the details:

  • Upgrade to Windows 11 where there is a new feature, WSLg, which directly supports GUI applications with both X11 and Wayland (the "successor" to X11).

  • Run a third-party X server such as VcXsrv on Windows 10

  • Run xrdp in Ubuntu and connect to it via the Remote Desktop application in Windows.

See:

For an (admittedly overly) long and detailed comparison (performance, memory, ease of installation, easy of use) of the options, see my answer.

The other error
expr: syntax error: missing argument after ‘8’

Even with an X server installed, you'll still receive this error message for the moment. This is a bug in Atom. It's fairly harmless, it seems, and Atom will still run just fine with that error message. It occurs because Atom doesn't anticipate that you might not be running a session manager, which you don't need under WSL.

If you run via Xrdp, however, you won't receive that error, since you will be running under a session manager.

Regardless, nothing to worry about, and it is reported to be fixed in the next release anyway.

NotTheDr01ds
  • 17,888
  • Comments are not for extended discussion; this conversation has been moved to chat. – andrew.46 Apr 29 '22 at 23:25
  • I have Windows 11 with Ubuntu 22.03 under WSL2 and atom doesn't work. expr: syntax error: missing argument after ‘8’ /usr/bin/atom: line 195: 909 Illegal instruction nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 [909:0624/052842.090087:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye. – Michael McLaughlin Jun 24 '23 at 04:30
  • Firefox and xeyes work fine. – Michael McLaughlin Jun 24 '23 at 04:32