Forum / NoMachine for Linux / Workaround to connect to undetectable sessions
- This topic has 1 reply, 2 voices, and was last updated 4 years, 1 month ago by Britgirl.
-
AuthorPosts
-
November 14, 2020 at 17:16 #30366Lex-2008Participant
Just wanted to share – maybe it will be helpful for others, not just me.
When NoMachine (free version) says it “cannot find the default environment” – it actually has a virtual X display which you can use. Longer explanation follows, script at the bottom.
So I’m running sway (Wayland compositor), and start it by typing <tt>sway</tt> on tty1.
I didn’t manage to make NoMachine (free version) connect to this session. I can start wayvnc – a VNC server for Wayland, but VNC performance is much inferior to NoMachine. Solution? Chain them together!
NoMachine seems to support many session types, but I wasn’t able to configure it to connect to VNC server on localhost:0 and serve as VNC repeater. However, there is a workaround.
When I connect to that machine from another one – it first says it “Cannot detect any display running” and offers me to create a new desktop. That’s because NoMachine can’t detect Wayland sway.
When you agree to create a new display – NoMachine first seems to connect (you see usual sequence of screens to mute audio, resize screen, etc), but at the end it says that it “Cannot find the default environment”.
If you stop at this moment, do not click “Ok” button, but SSH into the target host, and inspect /tmp directory – you see a file named like .X1001-lock. It means that NoMachine created a virtual X display :1001 and uses it to show that message. But actually you also can use that display to start any X application. As a simplest test, <tt>DISPLAY=:1001 xterm</tt> will give you a terminal.
Or, start your favorite vnc viewer (X-based, not wayland one) and point it to localhost:0. In my case, script to show wayland screen in place of “Cannot find the default environment” error message is like this:
wayvnc & DISPLAY=:1001 vncviewer -fullscreen localhost:0
Just run it when you see “Cannot find the default environment” error message and you will see your screen!
November 18, 2020 at 09:14 #30533BritgirlKeymasterSway desktop is not detected and as a result NoMachine can’t attach to it to display it (hence you see nothing).
A better workaround would be to put the command you are using in the node.cfg file instead. That way it would be automatic and you wouldn’t have to launch ‘vncviewer -fullscreen localhost:0’ every time you connect.
Try defining it in DefaultDesktopCommand in the NoMachine’s node configuration file.
-
AuthorPosts
This topic was marked as solved, you can't post.