FreeNX (Русский)

From ArchWiki

Jump to: navigation, search


i18n
English
Czech

Contents

[edit] Установка

Пакет разделён на две части:

  • freenx (сервер)
  • nxclient (клиент)

[edit] Настройка

[edit] Сервер

Открытая реализация сервера находится в пакете 'freenx'.

  • Чтобы разрешить вход на сервер, добавьте 'sshd' в список демонов в /etc/rc.conf.

Основной конфигурационный файл - /opt/NX/etc/node.conf. Если вы используете KDE или Gnome, то вам нет необходимости править этот файл, установки по умолчанию вам подходят. Если у вас другой оконный менеджер, такой как Fluxbox/Openbox или Xfce, вам может понадобиться слегка отредактировать этот файл (смотрите ниже).

[edit] Ключи

Ключи используются для аутентификации клиентов сервером. По умолчанию во время установки генерируется новый набор случайных ключей, один для сервера и один для клиентов. Вам понадобится скопировать этот клиентский ключ на каждую клиентскую машину (с Windows или Linux).

Клиентский ключ находится в файле /opt/NX/home/nx/.ssh/client.id_dsa.key.

Также вы можете использовать ключ по умолчанию, предоставляемый компанией NoMachine со всеми клиентами. В этом случае вам не нужно копировать сгенерированный ключ на каждую клиентскую машину. Чтобы сервер принимал дефолтный клиентский ключ, запустите

/opt/NX/bin/nxsetup --install --setup-nomachine-key --clean --purge

Пересоздать случайные ключи:

  • /opt/NX/bin/nxsetup --install --clean --purge

Перенести ключи на другой сервер freenx:

  • директория /opt/NX/home/nx/.ssh содержит файлы ключей
 -rw------- 1 nx root  697  9. Okt 12:55 authorized_keys
 -rw------- 1 nx root  668  9. Okt 11:48 client.id_dsa.key
 -rw------- 1 nx root  609  9. Okt 12:55 server.id_dsa.pub.key
  • Сохраните эти файлы
  • Добавьте эти файла на новый сервер. Им нужны те же самые права доступа, имена, группа и директория!
 # cp authorized_keys client.id_dsa.key server.id_dsa.pub.key /opt/NX/home/nx/.ssh/
 # chmod 600 /opt/NX/home/nx/.ssh/*
 # chown nx /opt/NX/home/nx/.ssh/*
 # chgrp root /opt/NX/home/nx/.ssh/*
  • Пересоздайте файл known_hosts:
 # echo -n 127.0.0.1 > /opt/NX/home/nx/.ssh/known_hosts
 # cat /etc/ssh/ssh_host_rsa_key.pub >> /opt/NX/home/nx/.ssh/known_hosts
 # chmod 633 /opt/NX/home/nx/.ssh/known_hosts
 # chown nx /opt/NX/home/nx/.ssh/known_hosts
 # chgrp root /opt/NX/home/nx/.ssh/known_hosts

[edit] Запуск сервера

После установки для запуска сервера не надо делать ничего вручную, он уже запущен. Единственная служба, которая необходима для соединения - sshd.

В действительности, если вы проверите список процессов (ps aux), вы не увидите запущенного nxserver. Причина в том, что nxserver действительно стартует только при входе в sshd специального пользователя 'nx'. В качестве оболочки (shell) для этого пользователя указан nxserver, так же, как для обычных пользователей указан bash.

[edit] Клиент

[edit] Arch Linux

Загрузите клиент с помощью pacman:

pacman -S nxclient

[edit] Windows

Загрузите клиент с сайта компании Nomachine: http://www.nomachine.com

Замечание: Nomachine собирается удалить старые клиенты с сайта, так что если ваша установка работает, сохраните её в надёжное место. :)

[edit] Настройка

Как упомянуто выше, клиент должен содержать правильный ключ для доступа к серверу. Если вы используете сгенерированные вами во время установки ключи, вам необходимо скопировать клиентский ключ в следующее месторасположение:

  • Windows: <yourinstalldironwindows>/share/keys/client.id_dsa.key
  • Arch Linux: /opt/NX/share/keys/client.id_dsa.key

После помещения ключей вам возможно придётся импортировать их с помощью nxclient GUI. В конфигурационном диалоге нажмите кнопку 'Key...' и импортируйте новый клиентский ключ.

[edit] Запуск

[edit] Горячие клавиши

CTR+ALT+F          Переключить полноэкранный режим. 
CTRL+ALT+T         Показать диалог завершения или приостановления сессии.
CTRL+ALT+M         Максимизировать или минимизировать окно.
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         Ленивое кодирование изображений.
CTRL+ALT+Shift+ESC Экстренный выход и закрытие окна.

[edit] Leaving fullscreen

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.

[edit] Tips on resume

  • Resume is a bit experimental, crashes might appear after session has resumed. You have to find out which apps like resuming and which do not ;) .
  • Resuming between Linux and Windows sessions does not work.
  • If resume fails let it time out and don't use the cancel button, else sessions will stay open and consume RAM on server. To kill such sessions use the Session Admin program to kill them.

[edit] Fix DPI settings

If 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

[edit] Setting up non-KDE or Gnome desktop managers

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.)

[edit] Alternative fix

A 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.conf

and change

#USER_X_STARTUP_SCRIPT=.Xclients

to

USER_X_STARTUP_SCRIPT=.xinitrc

Remember 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:

  • In the first group select - Run the default X client Script on server
  • In the second group select - New virtual desktop


[edit] Problems

[edit] Debug problems

Edit the nxserver config file:

 vi /opt/NX/etc/node.conf

Change:

 #SESSION_LOG_CLEAN=1

to

 SESSION_LOG_CLEAN=0

Then 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.


[edit] Authentication OK, but connection fails

If you are trying to startkde


 vi /opt/NX/etc/node.conf


And search for:

 COMMAND_START_KDE=startkde

Replace for:


 COMMAND_START_KDE=/opt/kde/bin/startkde


[edit] Key changes

Change the key in GUI setup to new generated key.

[edit] Xorg 7

Be aware that you have to remove the /usr/X11R6 directory, else strange things can happen.

[edit] Wrong password / No connection possible

  • If you get always wrong password or no connection after authentication was done and you are sure that you typed it correct, check that your server can connect to itself using localhost by ssh and that it is not blocked either by /etc/hosts.deny or not allowed by /etc/hosts.allow.
  • If you messed up your key files, create new ones or fix the old ones, it's probably caused by a wrong known_hosts file.

[edit] NX Crashes on session startup

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.

[edit] NX logo then blank screen

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: Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup

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.

[edit] 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 .xinitrc

If the file is not executable, simply

 chmod +x ~/.xinitrc

Keep in mind this command should be executed along with pertinent instructions on this page about "Setting up non-KDE or Gnome desktop managers"

Personal tools