Installing an SDE site with sde-install

By Paul Flanders · · Intermediate

Learn how to install and configure an SDE site on a GLServer host, including essential components like Guacamole and the SDE gateway. This guide is aimed at engineers and covers installation, configuration, and troubleshooting tips.

Install the core of an SDE site (Guacamole, the SDE gateway and the portal) on a GLServer host in one guided run, then check it, sign in and keep it backed up.

Applies to: sde-install on a GLServer host (Ubuntu), Guacamole 1.6.0 with MySQL 8.4 · Audience: engineers installing or looking after an SDE site · Time: about 1 hour, plus Active Directory preparation if you use it

1. What gets installed

Every part of SDE runs as a GLServer unit (one Docker container each) under /var/glitch-units/. The units join one Docker network called sde and reach each other by name. From outside the host, only the portal's port 443 is reachable.

UnitImageWhat it doesReached at
guac-dbmysql:8.4.13Guacamole's database (MySQL 8.4 LTS).guac-db:3306, network only
guacdguacamole/guacd:1.6.0Guacamole's proxy: makes the RDP, SSH and VNC connections for browser sessions. Holds the Guacamole drive in data/drive.guacd:4822, network only
guacamoleguacamole/guacamole:1.6.0The web portal and its REST API, served at /.guacamole:8080, network only unless you publish it
sde-networksde-networkSDE Network (private networks). Always installed; idle until an admin sets it up on its page.sde-network:8099
sde-gatewaysde-remote-gatewayThe RD Gateway (rdpgw, port 9443) and the SDE broker (port 8095) in one container: sign-in checks, native RDP authorisation, streaming, the usage report.sde-gateway:9443 and :8095
sde-nginxglitch-rproxyThe portal: TLS on 443 and the path routing to everything above.Host port 443

nginx routes by path, so one address and one certificate serve everything:

PathGoes to
/Guacamole, with its WebSocket tunnel
/remoteDesktopGateway/rdpgw: native RDP over WebSocket (the SDE Remote app)
/rpc/rdpgw: the legacy RD Gateway transport
/sde-broker/The broker (prefix removed), including the usage report at /sde-broker/report/
/stream-agent, /stream-connect, /stream-player, /stream-availableThe broker's streaming hub
/sde-network/, /sde-vdi/, /sde-vapps/, /sde-redirector/Admin pages, added only for the units that are installed

The add-ons (SDE VDI, SDE vApps, SDE Devices) are installed separately; see their own guides.

2. Before you start

You needDetails
A GLServer hostAn Ubuntu LTS VM with GLServer installed and licensed. gl -l must work: with an expired licence every gl command fails and nothing can be started.
Docker access to the imagesThe host must be able to pull the SDE images from the SDE image registry (SDE support provides the login). GLServer sets the Docker Hub login.
The SDE repository on the hostRun sde-install from a checkout of the repository: it copies the unit templates from deploy/glitch-units/, and Check runs the add-ons' own check scripts from there.
Toolsopenssl, curl and jq. whiptail gives the menus; without it (or with --plain) you get plain prompts.
RootRun every command with sudo. The units' settings files are root-only.
Disk and clockAt least 5 GB (and 10%) free under /var/glitch-units. The clock should be NTP-synchronised: sign-in tokens and AD depend on it.
The site addressThe FQDN users browse to, for example sde.lab.local, as it appears on the public certificate.
Firewall and TLSThe firewall forwards only 443 to the host. A load balancer or reverse proxy in front presents the public certificate; see section 7.
Active Directory (optional)The domain controller's name as on its certificate, LDAPS (port 636), the users' and groups' base DNs, a bind account and its password, and the AD CA certificate as a PEM file on the host.
The AD bind account and password changesThe installer gives the gateway the same bind account as Guacamole. For the app to complete a first-use ("must change at next logon") password change, that account needs Reset Password delegated on the users' OU. A read-only search account signs people in but can't do the reset. See Sign-in and passwords.

3. The sde-install commands

sudo deploy/installer/sde-install            # the menu
sudo deploy/installer/sde-install install    # a fresh site: Guacamole, then the core, then Check
sudo deploy/installer/sde-install guacamole  # install or repair Guacamole only
sudo deploy/installer/sde-install core       # gateway, nginx and SDE Network; the shared layout
sudo deploy/installer/sde-install check      # every smoke test, read-only
sudo deploy/installer/sde-install status     # components and versions
OptionWhat it does
--dry-runShows every change as a WOULD ... line and changes nothing.
--answers FILETakes every answer from FILE (KEY=value lines) and asks nothing. The keys are in deploy/installer/answers.example. The file holds passwords: chmod 600 it and delete it after the run.
--plainPlain prompts instead of menus.

In the menu, Install SDE, Check, Status and Add a component → Guacamole (install or repair) work today. Add a component for the add-ons, Upgrade, Settings and Backups aren't built yet: they show a message and change nothing.

Every change is shown before it's made, and every file the installer rewrites is first copied to <file>.bak-YYYYMMDD-HHMMSS. Secrets are never printed in full. Each run is logged to /var/log/sde-install/ (root-only). Running a step again repairs it: values that are already set are kept.

4. Run the install

  1. Copy or clone the repository onto the host and change to its folder.
  2. Preview the run: sudo deploy/installer/sde-install --dry-run install. Answer the questions; nothing is changed.
  3. Run it for real: sudo deploy/installer/sde-install install. It runs the Guacamole step (section 5), then the core step (section 6), then Check.
  4. Read the final Check. It ends with All OK or N to fix, with a FIX line for each problem.

If the Guacamole step fails, the install stops there. Fix what it reports and run install again.

5. The Guacamole step

Questions

QuestionAnswers keyDefault
Guacamole administrator's usernameGUAC_ADMIN_USERadmin
Its passwordGUAC_ADMIN_PASSWORDEnter = a random one
How do people sign in?SIGNINGuacamole accounts only (guac); or Active Directory (LDAP) (ad)
Domain controller, LDAPS port, users' base DN, groups' base DN, bind account and password, AD CA certificateAD_HOST, AD_PORT, AD_USER_BASE_DN, AD_GROUP_BASE_DN, AD_BIND_DN, AD_BIND_PASSWORD, AD_CA_FILEAsked only with AD. Port 636.
Publish Guacamole on a host port?GUAC_PUBLISH_PORTBlank = no
Copy connections and users from an existing GuacamoleMIGRATE_FROM_URL, MIGRATE_FROM_USER, MIGRATE_FROM_PASSWORDBlank = no

What it does

  1. Installs the guac-db, guacd and guacamole units from their templates, unless they're already there (then their settings are kept).
  2. Sets random MySQL root and guacamole user passwords in guac-db's enviroment (mode 600), once.
  3. Writes Guacamole's MySQL schema (from the Guacamole image's initdb.sh --mysql) to guac-db/data/initdb/initdb.sql. MySQL loads it on its first start only.
  4. Sets Guacamole to match usernames whatever their case (CASE_SENSITIVITY=disabled) and to serve at / (WEBAPP_CONTEXT=ROOT).
  5. With AD: writes the LDAP_* settings (LDAPS, sAMAccountName usernames, group names from cn), turns on MYSQL_AUTO_CREATE_ACCOUNTS so AD users get a database record on first sign-in, and builds a Java truststore with your AD CA in guacamole/data/trust.
  6. Creates the sde Docker network if needed and starts the three units in order, waiting for MySQL and then Guacamole to answer.
  7. Creates the accounts (below) and then deletes guacadmin. Guacamole 1.6's API can't disable an account, so it's removed.
  8. With a copy source: copies the connections and grants (below).
  9. With AD and an installed gateway: adds the Guacamole-only accounts to the gateway's SDE_LOCAL_ACCOUNTS and offers to restart the gateway.
  10. Runs the Guacamole checks.

Accounts

AccountWhat it's forPassword
admin (your choice of name)The site's administrator: a full Guacamole administrator, and so an administrator of every SDE admin page.The one you typed, or a random one kept in /etc/sde/secrets/guacamole-admin (root-only).
gua_srvThe service account the broker and the add-ons use to read and manage connections. Not for people.Random (or the gateway's existing SDE_GUAC_ADMIN_PASS), written only into the units' settings.
guacadminGuacamole's default account.Deleted.

Both admin and gua_srv get every Guacamole system permission (ADMINISTER, create users, groups, connections, connection groups and sharing profiles).

admin is a Guacamole-only accountIt isn't in AD, so it can't sign in to Windows desktops or desktop pools that use the user's own sign-in. Use it for administration and use an AD account to test desktops. See Sign-in and passwords.

Copying from an existing Guacamole

Give the old Guacamole's URL and an administrator account on it. The step reads, then copies:

  • the connections at the root of the old connection tree, with their parameters (a connection with the same name already in the new Guacamole is left as it is);
  • every user, each with READ on the copied connections they could use before.

Copied users get a random password. AD users sign in through AD as before; a local Guacamole user needs a new password set by an administrator. Connections in groups aren't copied: SDE VDI and SDE vApps re-create their own entries when they next start.

If another container already holds the port you chose to publish Guacamole on, the step offers to stop it (gl -d, answers key STOP_OLD_GUACAMOLE). Its data stays: gl -d guacamole then gl -s <old unit> brings it back.

6. The core step

Questions

QuestionAnswers keyDefault
Site name (for screens and logs)SITE_NAMESDE
Address users browse to (FQDN, as on the public certificate)SITE_FQDNThe host's name
Who presents the public certificate?TLSA load balancer or reverse proxy in front (upstream); or nginx itself (nginx)
Certificate and private key (PEM files on the host)CERT_FILE, KEY_FILEAsked only for nginx
Turn off for every connection (gateway-wide lock-down): Clipboard, Drive / file transfer, Printing, AudioLOCKDOWN (for example clipboard,drive)None ticked. Not asked when a configured gateway is already there: its lock-down is kept.
Publish only sde-nginx's 443?DROP_PORTSYes
SDE Network: address block, edge router's LAN address, LAN gatewayNETWORK_BLOCK, EDGE_IP, EDGE_GATEWAY10.250.0.0/16; edge address can be left empty for later

What it does

  1. Installs the sde-gateway, sde-nginx and sde-network units from their templates where they're missing.
  2. Fills in the gateway's settings that aren't set yet: the service account (SDE_GUAC_ADMIN_USER, SDE_GUAC_ADMIN_PASS), SDE_GATEWAY_HOST, SDE_GATEWAY_PORT=443, a 32-character SDE_TOKEN_SIGNING_KEY, and with AD the SDE_LDAP_* settings (the CA is fetched from AD automatically). It writes the lock-down choices as SDE_DISABLE_* and the app version notice (SDE_APP_VERSION, SDE_APP_DOWNLOAD_URL) from versions.conf. See Gateway settings.
  3. Adds a volume for the usage report's history (data/report), so it survives a container being recreated.
  4. Puts every SDE unit on the sde network and points them at each other by name (http://guacamole:8080 and so on).
  5. If you answered Yes to 443 only: stops the other units publishing ports (their lines in each unit's ports file are commented out). sde-nginx publishes 443.
  6. Sets up SDE Network: its settings, SDE_GUEST_NETWORKS in every unit, and a route on the host to the address block through the edge router (sde-network-route.service).
  7. Writes the nginx configuration (sde-nginx/data/config/default) from deploy/installer/templates/nginx-default.conf, with blocks for the installed units, and tests it with nginx -t before it goes live. A configuration that fails the test isn't installed.
  8. Restarts the units that changed, in order: guac-db, guacd, guacamole, sde-network, the add-ons, sde-gateway, sde-nginx. A unit whose settings still contain __SET_ON_HOST__ isn't started.
  9. Records the site in /etc/sde/install.conf (no secrets), waits for the portal to answer and runs Check.
Already have a hand-built site?sde-install core also moves an existing site onto this layout: it keeps set values, backs up each file it changes and shows every change first. Preview it with --dry-run.
Confirm the gateway addressAfter the core step, open /var/glitch-units/sde-gateway/glitch/config/enviroment and check that SDE_GATEWAY_HOST is the site FQDN. The installer only fills it in when it's empty, and the app's native RDP connects to this address.

7. Certificates and TLS

On SDE sites a load balancer or reverse proxy in front of the host presents the public certificate. Choose A load balancer or reverse proxy in front for these. nginx's own certificate is then internal: the core step makes a self-signed one for the FQDN (valid 10 years) in sde-nginx/data/certificates/ (cert.crt, cert.key). Check only warns if it is near expiry.

Choose nginx itself only where nothing sits in front and users see nginx's certificate. Give the full-chain certificate and its key as PEM files. Check then reports an expired or soon-expiring certificate as a FIX. To replace the certificate later, run sudo deploy/installer/sde-install core again, choose nginx itself and give the new files.

rdpgw also makes its own self-signed certificate on each start. Clients never see it: nginx talks to rdpgw over the internal network and doesn't check it.

The app and certificatesUsers' apps should trust the certificate they're shown (the public one). The app's Trust invalid certificate option is for test sites only.

8. Check and Status

sudo deploy/installer/sde-install check is read-only and safe to run at any time. Each line is OK, FIX, WARN or NOTE; the command exits with 1 when anything needs fixing. A copy is saved in /var/log/sde-install/.

SectionWhat it checks
HostDocker running, gl working, free disk, clock sync, /etc/sde/install.conf
UnitsEach unit running and healthy, no __SET_ON_HOST__ left, settings files mode 600, each unit's /healthz
GuacamoleThe three units; the API answers; the service account signs in and has ADMINISTER; with AD, each installer-made admin is in SDE_LOCAL_ACCOUNTS; guacadmin/guacadmin is refused
SDE gatewayThe gateway's built-in self-test (docker exec sde-gateway /opt/rdpgw/sde-selftest.sh); old settings that are no longer used
Portalnginx -t; the certificate's expiry; Guacamole, the broker, /sde-broker/clientconfig and the rdpgw WebSocket through 443; port 80
SDE Network, add-ons, ProxmoxThe route and unit; each installed add-on's own check; each Proxmox token
Lock-downWhich units still publish ports besides 443

sudo deploy/installer/sde-install status shows the site, whether gl works, each component with its running version against versions.conf, the last backup in /var/backups/sde/, and where the logs are.

Check from outside tooFrom another machine, confirm only 443 answers: nmap -Pn -p- sde.lab.local.

9. First sign-in

  1. Get the admin password if the installer chose it: sudo cat /etc/sde/secrets/guacamole-admin. Keep the file: Check uses it to find the installer-made admins.
  2. Browse to https://<FQDN>/ and sign in as admin. You'll see Guacamole's home page.
  3. In Settings, create or check your connections and give users (or AD groups) access to them.
  4. In the SDE Remote app, enter https://<FQDN>/ as the Guacamole URL and sign in with a user account. Leave Broker URL empty: the app uses /sde-broker on the same server.
  5. Open a Windows connection with native RDP to test the gateway. Use an AD account for this, not admin.
  6. From inside the network, open the usage report at https://<FQDN>/sde-broker/report/ and sign in as a Guacamole administrator. See Using the usage report.
Screenshot: SDE Remote app sign-in window with the Guacamole URL, Username and Password filled in

10. Updating images

sde-install upgrade isn't built yetThe Upgrade menu item and the upgrade command only show a message. Until they exist, update each unit by hand as below. Back up first (section 11).

The SDE units' unit.conf files use the :latest image tag (sde-remote-gateway:latest and so on). To move a unit to the newest published image, pull it and recreate the container. The gateway is the example:

docker pull "$(sed -n 's/^container=//p' /var/glitch-units/sde-gateway/glitch/config/unit.conf)"
gl -d sde-gateway && docker rm -f sde-gateway && gl -s sde-gateway
docker logs --tail 15 sde-gateway      # the start-up line shows the version
sudo deploy/installer/sde-install status
sudo deploy/installer/sde-install check

The docker rm -f matters: stopping and starting the unit alone can reuse the old container, with its old image and old settings.

  • Status compares what's running with deploy/installer/versions.conf, the list of versions for this release of SDE. A unit on a different version shows spec is x.y.z.
  • Guacamole and MySQL are pinned to exact tags in their unit.conf files (guacamole/guacamole:1.6.0, guacamole/guacd:1.6.0, mysql:8.4.13). The installer doesn't change these yet.
  • sde-nginx (glitch-rproxy:latest) isn't versioned yet.

11. What to back up

sde-install doesn't take backups yet: the daily backup timer and the Backups menu come with the upgrade work. Until then, back these up yourself, and always before updating a unit:

WhatWhereWhy
Guacamole's databaseA dump: docker exec guac-db sh -c 'exec mysqldump --single-transaction -uroot -p"$MYSQL_ROOT_PASSWORD" guacamole_db' > guacamole_db.sqlEvery user, group, connection, permission and the history. A dump is safer than copying guac-db/data/mysql while MySQL runs.
Every unit's settings/var/glitch-units/<unit>/glitch/config/ (enviroment, unit.conf, ports, volumes)All the secrets and choices. The enviroment files hold passwords: keep the backup root-only.
The gateway's report historysde-gateway/data/reportThe usage report's native RDP, streaming, pool and device history.
The portalsde-nginx/data/config and sde-nginx/data/certificatesThe nginx configuration and certificate.
Guacamole's AD trustguacamole/data/trustThe LDAPS truststore (rebuilt from the CA file if lost).
Guacamole drive filesguacd/data/driveFiles people moved through the Guacamole drive.
The installer's record and secrets/etc/sde/install.conf, /etc/sde/secrets/The site's answers and the admin password the installer chose.
Add-onsEach add-on unit's glitch/config and dataSee each add-on's guide.

12. Troubleshooting

ProblemFix
Check: "GLServer: ..." and nothing startsgl is failing, often because the GLServer licence has expired. Renew it, then run Check again.
"<unit> not started: placeholders left"A required value is still __SET_ON_HOST__ in that unit's enviroment. On a fresh site, run install (it runs the Guacamole step first, which provides the service account's password) rather than core on its own.
"admin isn't in the gateway's SDE_LOCAL_ACCOUNTS"With AD on, the app checks passwords with AD first and refuses accounts AD doesn't have. Run sudo deploy/installer/sde-install guacamole again (it adds them and offers to restart the gateway), or add the names to SDE_LOCAL_ACCOUNTS and recreate the gateway.
"guacadmin still has its default password"Run sudo deploy/installer/sde-install guacamole: it deletes guacadmin.
"<old unit> is on port 8080: it has to stop"You chose to publish Guacamole on a port another container holds. Let the step stop it, choose another port, or leave the port blank.
"the new nginx config fails nginx -t: not installed"The live configuration is unchanged. Read the nginx -t lines above the message, usually a certificate or key that doesn't match.
A route answers 502 through the portalnginx can't reach that unit. Check it runs (gl -l, docker ps) and is on the sde network.
"service account gua_srv can't sign in to Guacamole"SDE_GUAC_ADMIN_PASS in the gateway doesn't match the account's password in Guacamole. As admin, set gua_srv's password in Guacamole (Settings → Users) to the gateway's value, or the other way round and recreate the gateway. The add-ons use the same password.
A settings change doesn't take effectRecreate the container: gl -d <unit> && docker rm -f <unit> && gl -s <unit>.

person people found this useful.