It ensure to wait until the session is start-up.ģ) The nxserver -startsession command always exits with 0, regardless if the session has been created or not.I would like it to a open in fullscreen on both monitors without me having to CTRL-ALT-0 out every time and click the corresponding icon after logging in to my remote PC. The full display of the session may require longer, depending on time requested by the desktop to initialize all its processes.Ģ) The script introduces a sleep ( wait_time="20") necessary for checking RAM usage. # Display information after session startĮcho -e "\nINFO: New session used $(( $ram_before - $ram_after )) MB ram."Įcho "INFO: Free RAM left: $ram_after MB."Įcho "INFO: New session started in $((( time_after - time_before) /1000000 )) miliseconds."ġ) Time required to start the session is related to the time necessary to the server to launch the system command for creating the desktop or the application. Ram_after="$( free -m | grep Mem: | awk ' print $4 ' )" # Check RAM usage and time after session start etc/NX/nxserver -startsession -virtual -type $session_type # Start session with type defined as script argument Ram_before="$( free -m | grep Mem: | awk ' print $4 ' )" # Check RAM usage and time before session start # command should be executed by an unprivileged wait some time after session start to initialise all session processes # Do not execute this script as sudo user or root, the nxserver -startsession startsession 10 unix-application -application firefox # or to create 10 Firefox custom sessions running in a virtual desktop: # nxserver -startsession -virtual command. # This script creates multiple virtual desktop sessions using the INFO: New session started in 2439 miliseconds. NX> 152 Session started on display '1004'. INFO: New session started in 2481 miliseconds. NX> 152 Session started on display '1003'. INFO: New session started in 2408 miliseconds. NX> 152 Session started on display '1002'. This script, named sessionstart.sh, takes (i) the number of sessions to be created and (ii) the session type in input.įor example, to create three GNOME virtual desktops execute the script with: Workstation allows up to four virtual desktops, while Terminal Server has unlimited virtual desktops). The maximum number of virtual desktops that can be created is limited by the license type (e.g. It could be used also for benchmark tests. The following script is intended to be an example about how to use the new command. This could be useful for example for pre-launching virtual desktops which can be then reconnected by the corresponding users or connected in shadow mode from other users. Su - Adam -c "nxserver -startsession -virtual -type unix-default" to start the virtual desktop for user 'Adam': It's possible to use the 'nxserver -startsession' command to start a virtual desktop on user's behalf. Nxserver -startsession -virtual -type unix-application -application To start a custom application in virtual desktop mode: Nxserver -startsession -virtual -type unix-console To start the console application in virtual desktop mode: Nxserver -startsession -virtual -type unix-kde Nxserver -startsession -virtual -type unix-gnome Nxserver -startsession -virtual -type unix-default The -type parameter can be used to specify which type of desktop should be launched: It correspondes to ' -type unix-default'. If -type is not provided, this command will start the desktop environment defined in the DefaultDesktopCommand key in the /usr/NX/etc/node.cfg file. The server command to create virtual desktops is: This feature can be used also for making benchmark tests useful to sizing the HW of the NoMachine server host machine or of the Terminal Server Node in case of a multi-node environment. Such command line tool is intended to be run as non privileged user, the virtual desktop will be run for the user who executes the command. Since version 6.2, a new server's tool is available for starting virtual desktop sessions on Linux from command line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |