blend-os / blendOS

A seamless blend of all Linux distributions.
GNU General Public License v3.0
772 stars 22 forks source link

NoMachine installation support request #94

Open roukmoute opened 10 months ago

roukmoute commented 10 months ago

Hello,

Would it be possible to enlighten me on a possible installation of NoMachine? I had the opportunity to install it from an Ubuntu container and noticed that the client works flawlessly after installing gsfonts-x11.

However, I seem to have a problem with the server installation. Here are the details obtained during installation:

$ sudo dpkg -i nomachine_8.8.1_1_amd64.deb 
[sudo] Mot de passe de roukmoute :          
Selecting previously unselected package nomachine.
(Reading database ... 10309 files and directories currently installed.)
Preparing to unpack nomachine_8.8.1_1_amd64.deb ...
Unpacking nomachine (8.8.1-1) ...
Setting up nomachine (8.8.1-1) ...
NX> 700 Starting installation at: Wed, 23 Aug 2023 15:58:02.
NX> 700 Using installation profile: Ubuntu.
NX> 700 Installation log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Installing nxrunner version: 8.8.1.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-icon.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-icon.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-icon.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-icon.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-desktop.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-desktop.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-desktop.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-desktop.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-video.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-video.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-video.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-video.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-recording.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-recording.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-recording.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-recording.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-service.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-service.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-service.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-service.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/16x16/NoMachine-web.png to: /usr/share/icons/hicolor/16x16/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/22x22/NoMachine-web.png to: /usr/share/icons/hicolor/22x22/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/32x32/NoMachine-web.png to: /usr/share/icons/hicolor/32x32/apps/.
NX> 700 Cannot copy: /usr/NX/share/icons/48x48/NoMachine-web.png to: /usr/share/icons/hicolor/48x48/apps/.
NX> 700 Installing nxplayer version: 8.8.1.
NX> 700 To connect the remote printer to the local desktop,
NX> 700 the user account must be a member of the CUPS System Group..
NX> 700 Player install completed with warnings.
NX> 700 Please review the install log for details.
NX> 700 Installing nxnode version: 8.8.1.
/usr/NX/scripts/setup/nxnode: line 16275: pkcheck: command not found
/usr/NX/scripts/setup/nxnode: line 16284: [: -ge: unary operator expected
NX> 700 ERROR: Error in CUDA initialization..
NX> 700 Displaying file: /usr/NX/share/documents/node/cups-info

 CUPS Printing Backend

 The  NoMachine Node  setup procedure could not detect your
 CUPS installation: either  CUPS  is not installed on  your
 system or it was installed in a non-standard path. CUPS is
 needed  in order to  enable  printing  support  in your NX
 system.
 Please note that you can enable  printing support for your
 NX system at any time; to do this make sure  that you have
 CUPS installed then run:

   /usr/NX/scripts/setup/nxnode --printingsetup <pathname>

 to specify the location of the CUPS root path.

NX> 700 Displaying file: /usr/NX/share/documents/node/pulseaudio-info

 PulseAudio Backend

 The NoMachine  setup procedure  could not  detect  your  PulseAudio
 installation:  either  PulseAudio is not  installed  on your system
 or it was  installed  in a non-standard path.  If PulseAudio is not
 available, NoMachine audio support will try to rely on ALSA device.
 Please note  that you can enable  PulseAudio  support  at any time;
 to do this  make sure that you have PulseAudio installed, then run:

   /usr/NX/scripts/setup/nxnode --audiosetup <path>

 to specify the location of the PulseAudio configuration files.
NX> 700 Installing nxserver version: 8.8.1.
NX> 700 ERROR: Cannot enable systemd service: .
NX> 700 Server install completed with warnings.
NX> 700 Please review the install log for details.
NX> 700 Installation completed with errors at: Wed, 23 Aug 2023 15:58:20.
NX> 700 NoMachine was configured to run the following services:
NX> 700 NX service on port: 4000

When I inspected the listening ports, I couldn't find port 4000. Is it possible to solve this problem?

$ sudo netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:46264         0.0.0.0:*               LISTEN      5885/nxrunner.bin   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:37334         0.0.0.0:*               LISTEN      5813/nxplayer.bin   
tcp        0      0 127.0.0.54:53           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 :::5355                 :::*                    LISTEN      -                   
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)

And we can see that information in the window of nomachine, the server can't start: image

Also, is there a pre-installation script to install binaries before the O.S. becomes immutable?

Thank you very much for your time and assistance.

Ast3risk-ops commented 10 months ago

this is better on the host, use the mutifier to install nomachine from the AUR using git and makepkg.

roukmoute commented 10 months ago

Thank you for your previous reply. Following your advice, I tried to follow the procedure you suggested. Here are the steps I took:

$ git clone https://git.blendos.co/asterisk/blendos-mutifier.git
$ cd blendos-mutifier/
$ sh install.sh 
Installing gum, this requires elevation (enter your password)
[sudo] Mot de passe de roukmoute :          
>> i: attempting to acquire system lock
>> i: this operation will replace the current overlay on the next boot

Spawning container blendrw on /.blendrw.
Press Ctrl-] three times within 1s to kill container.
Host and machine ids are equal (ead2f83f56628892b66a930a658e4416): refusing to link journals
:: Synchronizing package databases...
core
extra
core is up to date extra is up to dateresolving dependencies...
looking for conflicting packages...

Packages (1) gum-0.10.0-1

Total Installed Size:  27.10 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                     [------------------------------------] 100%
(1/1) checking package integrity                                   [------------------------------------] 100%
(1/1) loading package files                                        [------------------------------------] 100%
(1/1) checking for file conflicts                                  [------------------------------------] 100%
:: Processing package changes...
(1/1) installing gum                                               [------------------------------------] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Container blendrw exited successfully.
>> i: you are requested to review the operation's output
>> i: press ENTER to proceed with making overlay permanent, or ^C to abort
>> i: (aborting will also remove any packages installed previously without rebooting)

>> i: reboot to apply changes
run exec bash (or close and re-open your terminal) to complete install, and add these tools to your PATH!
$ reboot
$ ./mutifier 
Controls: Arrow keys to move, enter to select
What would you like to mutify?
Mutifying consists of remounting your chosen partition (in this case /usr/) as read-write.
[sudo] Mot de passe de roukmoute :          
/usr/ will be read-writeable until you reboot.
$ cd /usr/
$ sudo wget https://download.nomachine.com/download/8.8/Linux/nomachine_8.8.1_1_x86_64.tar.gz
$ sudo tar zxvf nomachine_8.8.1_1_x86_64.tar.gz 
NX/
NX/nxserver
NX/etc/
NX/etc/NX/
NX/etc/NX/server/
NX/etc/NX/server/localhost/
NX/etc/NX/server/localhost/server.cfg.sample
NX/etc/NX/server/packages/
NX/etc/NX/server/packages/nxnode.tar.gz
NX/etc/NX/server/packages/nxrunner.tar.gz
NX/etc/NX/server/packages/nxplayer.tar.gz
NX/etc/NX/server/packages/nxserver.tar.gz
README-NOMACHINE
$  sudo /usr/NX/nxserver --install redhat
$ sudo ./nxserver --install redhat
awk: fatal : impossible d'ouvrir le fichier « /usr/NX/etc/server.cfg » en lecture : Aucun fichier ou dossier de ce type
/etc/NX/nxserver: ligne 167: /usr/NX/bin/nxserver.bin: Aucun fichier ou dossier de ce type
NX> 700 Starting installation at: Wed, 23 Aug 2023 22:51:35.
NX> 700 Using installation profile: Red Hat.
NX> 700 Installation log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Installing nxrunner version: 8.8.1.
/usr/bin/grep: avertissement : \ surnuméraire avant /
NX> 700 Installing nxplayer version: 8.8.1.
NX> 700 Installing nxnode version: 8.8.1.
NX> 700 ERROR: Error in CUDA initialization..
NX> 700 Displaying file: /usr/NX/share/documents/node/pulseaudio-info

 PulseAudio Backend

 The NoMachine  setup procedure  could not  detect  your  PulseAudio
 installation:  either  PulseAudio is not  installed  on your system
 or it was  installed  in a non-standard path.  If PulseAudio is not
 available, NoMachine audio support will try to rely on ALSA device.
 Please note  that you can enable  PulseAudio  support  at any time;
 to do this  make sure that you have PulseAudio installed, then run:

   /usr/NX/scripts/setup/nxnode --audiosetup <path>

 to specify the location of the PulseAudio configuration files.
NX> 700 Installing nxserver version: 8.8.1.
NX> 700 Server install completed with warnings.
NX> 700 Please review the install log for details.
NX> 700 Installation completed with errors at: Wed, 23 Aug 2023 22:51:58.
NX> 700 NoMachine was configured to run the following services:
NX> 700 NX service on port: 4000

These steps seem to have worked in part, since the NoMachine server starts up correctly.
image

Furthermore, from the NoMachine client, I can detect this server.
image

However, when trying to connect to the machine, I get the following error message: "cannot find the default environment. Please contact your system administrator.". image

I discovered this thread on the NoMachine forum which seems to address the same concern: Link to forum. However, I'm not sure how to go about adapting it to the O.S. Do you have any suggestions?

In addition, I've noticed another challenge: everything works fine until I reboot the machine. After a reboot, the server doesn't seem to want to start. Do you have any clues on this second point?

I'm very grateful for any help you can give me.

Ast3risk-ops commented 10 months ago

/usr/ is only rw for your current session, reboot and it's read-only again.

Ast3risk-ops commented 10 months ago

I'm not sure, but it might be because the desktop is on some other layer

Ast3risk-ops commented 10 months ago

you can try applying the forum solution as-is, just be careful.

jacklh9 commented 9 months ago

Just want to throw my experience in having tried via AUR and via @roukmoute method and the forum solution combos. NX Machine is working for me having done as follows:

NOTE: In my case I'm running the LXQT desktop via "sudo system track".

FAILED ATTEMPT #1 using AUR makepkg per @Ast3risk-ops:

NOTE: Backup created at this point prior to starting the below process.

The following were required dependencies to get everything to install later: sudo system install gum git nawk rpm-tools fakeroot

reboot cd ~ git clone https://git.blendos.co/asterisk/blendos-mutifier.git cd ~/blendos-mutifier/ chmod u+x mutifier ./mutifier

Follow the on-screen prompts to make /usr mutable.

cd ~ git clone https://aur.archlinux.org/nomachine.git cd ~/nomachine

Edit ./PKGBUILD file's vars as desired (e.g., autostart = y, firewall mods = y)

makepkg -si

The package builds but fails to install, complaining that it could not get the lock when it ran pacman -U (which I understand it cannot do since BlendOS replaced pacman with "system" command.)

As a result, I had to do the following:

Revert to backup

SUCCESSFUL ATTEMPT #2: (Install non-AUR, tar-ball NX to /opt instead of /usr)

The following were required dependencies to get everything to install: sudo system install gum git reboot

NOTE: Despite not installing NX to /usr and instead to /opt, we still need to mutify /usr because NX will still install some dependency files to /usr cd ~ git clone https://git.blendos.co/asterisk/blendos-mutifier.git cd blendos-mutifier chmod u+x mutifier ./mutifier

Follow the on-screen prompts to make /usr mutable.

cd ~ wget https://download.nomachine.com/download/8.8/Linux/nomachine_8.8.1_1_x86_64.tar.gz tar zxvf nomachine_8.8.1_1_x86_64.tar.gz

Since installing to /usr and rebooting will render /usr read-only, which @roukmoute had an issue with, I'm going to have NX install to non-usr directory: sudo NX_INSTALL_PREFIX=/opt NX/nxserver --install redhat

NX complains about Pulse Audio not being installed but I don't care since I don't need sound from my VM guests hosted in my ProxMox hypervisor.

Determine your window manager start command: ls /usr/share/xsessions

My output: lxqt.desktop openbox-kde.desktop openbox.desktop

grep Exec /usr/share/xsessions/lxqt.desktop Output: Exec=startlxqt

Add the start command to NX config: sudo vi /opt/NX/etc/node.cfg

With the vi editor, edit /opt/NX/etc/node.cfg file and uncomment DefaultDesktopCommand and add there “startlxqt” (or your Window Manager start command) so that the entire line should look like this: DefaultDesktopCommand "startlxqt"

NOTE: I had to use vi to edit node.cfg. If I used an editor like emacs (from a container) then it did not have permissions to edit the file unless I temporarily granted access via chmod o+rw on node.cfg.

Save and exit

reboot

Connect with your NX client.

And then on client connection you should get a prompt: "Cannot detect any display running. Do you want NoMachine to create a new display and proceed to connect to the desktop?" I checked the box "Always create a new display on this server" and clicked the Yes button. Eventually you should be able to log in as non-console (physical display).

NOTE: If you do not get this prompt the first time after log in (to enable non-physical console login), just reboot again and it eventually works.

Future steps are to see if sound works by installing Pulse Audio, but I wanted to at least post my present working solution, thanks to most of the leg work from @roukmoute and @Ast3risk-ops. Hope this helps.

Ast3risk-ops commented 9 months ago

@roukmoute feel free to tell me if this works.

jacklh9 commented 8 months ago

@Ast3risk-ops There does appear to be a very bad side-effect post-install. While no-machine is working just fine, the rest of the system ceases to function normally. The following errors appear when trying to use basic commands associated to existing containers. In this case, I'm trying to run "emacs" from a debian container named "local-debian".

I log into the Blend OS desktop via no-machine remote connection GUI and launch QTerminal (via lxqt desktop) and type "emacs", I get:

WARN[0000] RunRoot is pointing to a path (/run/user/1000/containers) which is not writable. Most likely podman will fail.
Error: default OCI runtime "crun" not found: invalid argument

The above error repeats each time I try to run "emacs". But if I then SSH from an external client (WSL) to BlendOS and within that SSH terminal I launch "emacs", I get this new error:

Error: can only create exec sessions on running containers: container state improper

If I then return to no-machine GUI (never logged out) and run "emacs", I now get this on all "emacs" runs:

WARN[0000] The cgroupv2 manager is set to systemd but there is no systemd user session available
WARN[0000] For using systemd, you may need to log in using a user session
WARN[0000] Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root)                                                     
WARN[0000] Falling back to --cgroup-manager=cgroupfs                                                                                                          
Error: can only create exec sessions on running containers: container state improper                                                                          
WARN[0000] Failed to add pause process to systemd sandbox cgroup: dial unix /tmp/dbus-cRqRBRepCO: connect: no such file or directory

If I try to delete the container and recreate as follows:

user delete-container local-debian
user create-container local-debian debian
user associate apt local-debian
sudo apt install emacs-nox
user associate emacs local-debian

... then emacs works perfectly well in the no-machine GUI session and via SSH terminal session until the next reboot when the same issue re-appears for the recreated container (i.e., local-debian) and command (i.e., emacs).

I have replicated this multiple times, installing no-machine on fresh BlendOS install with nothing else installed (Linux blend 6.3.9-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 21 Jun 2023 20:46:07 +0000 x86_64 GNU/Linux), but the post-install side-effect returns. Not sure why the no-machine install to /opt (and use of mutify) is breaking the system, despite no-machine continuing to function just fine.

Ast3risk-ops commented 8 months ago

You may need to investigate this issue through podman, as that seems to be what is causing the problem.