14.2 Configuring the webdesktop Service

 Follow these steps to configure the webdesktop service and run it on an SC:

  1. Use the following mzsh topo command to add the service to custom.conf:

    $ mzsh topo set topo://services:custom/obj:webdesktop.webdesktop1 '
    config : { http-port : <port>,
    http-host: <host>,
    allowed-clients: <no. of clients>,
    total-memory: <total memory>,
    memory-selection: <true or false>,
    memory-options: [<memory options for selection>],
    space-selection: <true or false>,
    sc-list : [<SC name>] },
    template : 1/standard/basic'
    SettingDescription
    http-portDefault value: 9999

    The port where you want to access the Desktop in your browser.

    http-hostDefault value: 0.0.0.0

    The host where you want to access the Desktop in your browser.

    allowed-clientsDefault value: 4

    The number of clients that are permitted.

    total-memory

    Default value: 1024

    The total amount of memory permitted in MB for all of the connected clients. You allocate the amount of memory per client in the memory-options setting.

    The memory allocated determines how many clients can be connected simultaneously.

    memory-selectionDefault value: true

    This setting determines if a Memory dropdown is provided in the Desktop login dialog where you can select the amount of memory permitted for the current client. If you set the value to false, the Memory field is not visible and a default value of 256 MB is used for each connected client. If you want to set another value, you can configure a single value in the memory-options setting and this value will be used.
    memory-options

    Default value: 256, 512, 1024

    The memory options available for selection for the current client in MB.

    If you want to set the memory to the same value for each client, enter a single value. If you then set the value for memory-selection to true, only this value is displayed in the Memory dropdown. If it is set to false, the Memory field is not visible.

    If a value exceeds the total-memory setting, it will be excluded from the Memory dropdown.

    Note!

    Bear in mind that the number of clients permitted and the amount of memory permitted per client must be within the total memory that you set. For example, the default value of 1024 MB would allow 4 clients using 256 MB to be connected simultaneously, or 1 client with 512 MB and 2 clients with 256 MB.

    space-selectionDefault value: false

    This setting determines if a Configuration Space dropdown is provided in the Desktop login dialog where you can select to login to a configuration space.

    If you want to configure the service to accept all of the default values of the options listed and you use sc1, use the topo command:

    $ mzsh topo set topo://services:custom/obj:webdesktop.webdesktop1 "config : { sc-list : [sc1] }, template : 1/standard/basic"

    If you accept all of the default values, the login dialog appears as shown in the image below in step 4.

    Example - Adding the Desktop service to custom.conf

    In this example the service is named webdesktop1, the number of clients permitted is set to 2, the host is localhost, the port is 9999 and the SC is sc1. The default values will be used for the rest of the settings.

    $ mzsh topo set topo://services:custom/obj:webdesktop.webdesktop1 "config : { http-port : 9999, http-host: localhost, allowed-clients: 2, sc-list : [sc1] }, template : 1/standard/basic"
    webdesktop {
        webdesktop1 {
            config {
                allowed-clients=2
                http-host=localhost
                http-port=9999
                sc-list=[
                    sc1
                ]
            }
            template="1/standard/basic"
        }
    }

    Note!

    The host that will run the Web Desktop Server must have a display output. To start the server on a headless host, you can use e g Xvfb for this purpose.

    Example - Setting display to Xvfb

    $ export DISPLAY=:99
    $ Xvfb :99 &
  2. Start the Desktop service by entering the following:

    $ mzsh service start
  3. Start the web browser, entering the corresponding host and port: http://<http host>:<http port>/auth.

  4. In the login dialog, enter your username and password. If the memory selection is set to true in the custom.conf for the service, you can also set the amount of memory allocated to the client from the Memory dropdown.


    Desktop Login dialog


Updating the Desktop

 Follow these steps to update individual properties and to restart the webdesktop service:

  1. Use the following mzsh topo command to modify the relevant property value:

    mzsh topo set topo://services:custom/val:webdesktop.webdesktop1.config.<property> <value>

    Example - Updating the port to 8989 in the Desktop configuration

    mzsh topo set topo://services:custom/val:webdesktop.webdesktop1.config.http-port 8989
  2. Restart the Desktop service using the following command:

    mzsh service update -i webdesktop/webdesktop1 -c restart

    Note!

    Running the mzsh service update command with the flag -c restart shuts down the server, with all running instances of the Desktop and restarts it with the new configuration. If you omit the flag -c restart in the command, the changes take effect after the next restart of the SC instead.

Starting the Desktop

Start the Desktop by entering the URL in a web browser in accordance with your configuration: 

http://<http host>:<http port>/auth

or 

https://<http host>:<http port>/auth

For information about enabling HTTPS, see 4.3.3 HTTP Standard Setup.