|
NX 是一项令人激动的远程控制技术。它提供了在高延迟、低带宽环境中 接近本地速度 的应用程序响应链接。NX 的核心库由 NoMachine 在 GPL 授权下提供。FreeNX 是一个 NX 服务器和客户端组件的 GPL 实现。
— FreeNX - 自由的 NX安装包分为两部分:
如果你打算用 freenx 来连接无头 PC,记得你得有一个配置好的 X 服务器,这样你应该就能安装任何与 xorg 相关联的包了。
设置服务器自由(免费)的服务器在 'freenx' 包中。你必须安装 sshd 守护进程,并且让它正确运行:
# systemctl enable sshd要使 freenx 的登录验证工作,sshd 必须正确配置。检查 /etc/ssh/sshd_config 中下列项:
RSAAuthentication yes AllowUsers someuser nxNX 的主配置文件位于:
/opt/NX/etc/node.conf如果你的 ssh 守护进程不是运行在默认的 22 端口,你需要取消注释并修改:
SSHD_PORT=22如果你在用 Gnome 或 KDE 桌面环境,你不需要编辑此文件,应为修改过的 MD5SUM 与默认配置在这种场合下能够工作。如果你在使用其它窗口管理器,比如 Fluxbox/Openbox 或 Xfce,你大概需要稍微修改这个文件(见下方)。
安装完 freenx 包,运行 /opt/NX/bin/nxsetup --help for an overview of the install and uninstall procedures.
服务器需要用密钥来验证客户端。默认情况下,在安装时会产生一对随机密钥,一个是服务器的,另一个是客户端的。你需要给每一个想要连接的客户端(Windows 也好, linux 也好)复制一份客户端密钥。
客户端密钥能在这儿找到:
/opt/NX/home/nx/.ssh/client.id_dsa.keyAlternatively you can use the default key that is provided by NoMachine with all clients. In this case you do not need to copy a custom generated key to each client. To get the server to accept the default client keys run:
/opt/NX/bin/nxsetup --install --setup-nomachine-keyRecreation of random keys:
/opt/NX/bin/nxsetup --installTransferring nx keys to another freenx server:
Once installed the server is effectively running and ready to go, you do not have to do anything manually The only thing that must be running in order to connect is the sshd daemon. This is because the nxserver is actually started by logging into sshd as the special user 'nx'. This user has been set up to use the nxserver as its shell, much like a normal user has bash as the default shell.
You can specify the local addresses sshd should listen for by editing /etc/ssh/sshd_config and adding them in the following format:
ListenAddress host|IPv4_addr|IPv6_addrThe original ListenAddress in sshd_config is 0.0.0.0. This listens to all addresses, however adding any address will take precedent to this and and accept connections from the new address only.
Restart the sshd daemon to put any changes to its configuration into effect:
# systemctl restart sshdIn actual fact, if you check the process list (ps aux) you may not see the nxserver running even though it is. This is because the nxserver is actually started by logging into sshd as the special user 'nx'. This user has been set up to use the nxserver as its shell, much like a normal user has bash as the default shell.
客户端Arch LinuxGet the client from pacman:
pacman -S nxclient WindowsGet the client from nomachine's homepage: http://www.nomachine.com
Tip: Nomachine tends to remove old clients from their homepage, If your setup works with a client save it at a safe place ;)
配置As mentioned above, the client must contain the correct key to connect to the server. If you are using the custom keys generated during install, you need to copy the client key to the following locations:
After moving the keys you may have use the nxclient GUI to import the new keys. From the configuration dialog press the 'Key...' button and import the new client key.
After installing nxclient on Arch Linux, executables are available in /opt/NX/bin. At the first run of /opt/NX/bin/nxclient, the user will be led through a wizard.
键盘快捷键CTR+ALT+F Toggles full-screen mode. CTRL+ALT+T Shows the terminate, suspend dialog. CTRL+ALT+M Maximizes of minimizes the window CTRL+ALT+Mouse Drags the viewport, so you can view different portions of the desktop. CTRL+ALT+Arrows or Moves the viewport by an incremental amount of pixels. CTRL+ALT+Keypad CTRL+ALT+S It will activate "screen-scraping" mode, so all the GetImage originated by the clients will be forwarded to the real display. This should make happy those who love taking screenshots ;-). By pressing the sequence again, nxagent will revert to the usual "fast" mode. CTRL+ALT+E lazy image encoding CTRL+ALT+Shift+ESC Emergency-exit and kill-window 退出全屏There is a magic-pixel in the top right corner of nearly every nx-application in fullscreenmode. Right-click the pixel and application-window gets iconified.
Tips on resumeIf you like to have the same font-sizes/dpi sizes on all your client session, set the X resource "Xft.dpi". For example putting the following line into a user's "~/.Xresources" makes her/his "desktop" a 100dpi. Xft.dpi: 100
在已有屏幕上使用 FreeNXUsually, when connecting to a NX server, a new X session is created. Sometimes it might be useful, to connect to an existing X session, e.g. the root session. This is not possible with NX in default setup, but can be reached, using tightvnc and x11vnc. Do the following steps on the NX server system.
# pacman -S tightvnc x11vncx11vnc will serve the X session, we have to create a file $HOME/.x11vncrc to give x11vnc some options, e.g.:
display :0 shared forever localhost rfbauth /home/USER/.x11vnc/passwdCreate the VNC password file:
$ mkdir $HOME/.x11vnc $ x11vnc -storepasswd PASSWORD $HOME/.x11vnc/passwd $ chmod 600 $HOME/.x11vnc/passwdCreate a shell script, which starts the x11vnc service, if not running and starts the vncviewer provided by the package tightvnc.
Save this script with a texteditor of your choice, e.g. under $HOME/shell/nxvnc.sh. Make it executable and create a symbolic link, e.g:
$ chmod +x $HOME/shell/nxvnc.sh # ln -s /home/USER/shell/nxvnc.sh /usr/local/bin/nxvncAt this point, you might want to test the current configuration: $ /usr/local/bin/nxvnc
If the x11vnc service and a vncviewer session is started, you configuration works well. You are now able to connect to the current X session using your NX client with following options:
Login, Password, Host, Port: your default entries Desktop: Unix -> Custom - Settings: - Run the following command: /usr/local/bin/nxvnc - New virtual desktop Display: - Fullscreen or Custom with you preferred resolutionYou are able to connect to your current X session via NX client now.
— FreeNX to existing display (opensuse.org)设置非 KDE 或非 Gnome 桌面管理器Before following anything in this part, make sure the server working setup and accepting connections. This section only deals with problems once NXClient has logged on.
It is quite simple (once the server is setup) to connect to Gnome and KDE sessions, however connecting to other window managers (fluxbox, xfce, whatever) is slightly different.
Choosing "custom" and using a command like startx of startfluxbox will either result in a blank screen after the !M logo or the Client to present an error complaining about lack of a X server. A way around this is open a session with the command "startx", and the another with the command to start your window-manager-of-choice.
If you do not want to do this, you can start X by installing a login manager like SLIM or XDM. I would recomend using SLiM because of it's small size.
(Authors note: This is how I got fluxbox, xfce and others to work on my arch installation- however, I have now removed slim from inittab and set the run level back to 3, and yet I can still login perfectly with NXClient. Possibly try this if you get your system working this way, if like me you have a low memory machine.)
Alternative fixA simple fix without resorting to the above seems to involve a simple edit to the config file. This should work for fluxbox/openbox/xfce or any other window manager that uses the .xinitrc startup file in a call to startx.
Simply edit the config file (as root):
/opt/NX/etc/node.confand change
#USER_X_STARTUP_SCRIPT=.Xclientsto
USER_X_STARTUP_SCRIPT=.xinitrcRemember to remove the # symbol from the start of the line.
Then in the client under configuration settings, choose Custom as the desktop, and click on settings:
Edit the nxserver config file:
vi /opt/NX/etc/node.confChange:
#SESSION_LOG_CLEAN=1to
SESSION_LOG_CLEAN=0Then you can look/debug the log files in:
$HOME/.nx/T-C-<hostname>-<display>-<session-id>For succesfull connections and:
$HOME/.nx/F-C-<hostname>-<display>-<session-id>For failed ones.
If you are trying to startkde
And search for:
COMMAND_START_KDE=startkdeReplace for:
Change the key in GUI setup to new generated key.
Xorg 7Be aware that you have to remove the /usr/X11R6 directory, else strange things can happen.
密码错误 / 没有可用连接If your NX Client shows the NX logo then disappears with a Connection Problem dialog afterwards.
Then it could be due to missing fonts. Mostly applies if you have installed Arch Linux base and then installed freenx after without the whole X11 set.
Solution until FreeNX Dependencies is fixed is to install xorg-fonts-misc on your NX Server (pacman -S xorg-fonts-misc) and your NX should work.
Note: This does not apply to freenx 0.6.1-3 and above, fix has been incorporated in it and following versions.
显示 NX 徽标之后黑屏If you see the NX logo (!M) then a blank screen.
This problem can be solved by running a login manager- The problem is that X11 is not started, and it appears that "startx" or similar do not work from the freenx client. Follow these instructions to setup a login manager and load it at startup: Display manager
Blind: If this does not resolve your issues, be aware that freenx and bash_completion do not play well together. I only got things to work after removing bash_completion from the .bashrc.
GDM/XDM Session Menu Error with non-KDE or Gnome Desktop Managers (more common with non-Arch Linux users)Problem: A session menu comes up talking about "chooseSessionListWidget." A window manager never loads.
Fix :
Double check to see if ~/.xinitrc is executable.
ls -la ~/ | grep .xinitrcIf the file is not executable, simply
chmod +x ~/.xinitrcKeep in mind this command should be executed along with pertinent instructions on this page about "Setting up non-KDE or Gnome desktop managers"
If you get the following error while connecting
/opt/NX/bin/nxserver: line 941: sessreg: command not found NX> 280 Exiting on signal: 15then you have to install the package xorg-server-utils.
GMT+8, 2024-4-19 23:08 , Processed in 0.022985 second(s), 15 queries .
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.