From 9ad238069285d68c14d0db2cd6ceb7cbb2664146 Mon Sep 17 00:00:00 2001 From: Dawa Ometto Date: Wed, 8 Nov 2023 17:38:15 +0100 Subject: [PATCH] Add RDP support to Ubuntu desktop image --- ubuntu/focal_desktop/variables.auto.pkrvars.hcl | 3 ++- ubuntu/src-ubuntu.pkr.hcl | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ubuntu/focal_desktop/variables.auto.pkrvars.hcl b/ubuntu/focal_desktop/variables.auto.pkrvars.hcl index bdd97fd..bda7dcc 100644 --- a/ubuntu/focal_desktop/variables.auto.pkrvars.hcl +++ b/ubuntu/focal_desktop/variables.auto.pkrvars.hcl @@ -2,5 +2,6 @@ docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace:ubuntu img_tag = "ubuntu_focal-desktop" docker_base_img = "ubuntu:focal" vagrant_base_img = "ubuntu/focal64" -extra_packages = "xfce4" +extra_packages = "gdm3 xfce4 xrdp xauth xorgxrdp" +extra_post_commands = "update-alternatives --set x-session-manager /usr/bin/xfce4-session" workspace_ansible_version = "2.9" diff --git a/ubuntu/src-ubuntu.pkr.hcl b/ubuntu/src-ubuntu.pkr.hcl index 5096de8..09bd6ad 100644 --- a/ubuntu/src-ubuntu.pkr.hcl +++ b/ubuntu/src-ubuntu.pkr.hcl @@ -66,6 +66,11 @@ variable "extra_packages" { type = string } +variable "extra_post_commands" { + default = "" + type = string +} + variable "testuser" { type = map(string) default = { @@ -191,7 +196,8 @@ build { inline = [ "useradd -m -s $(which bash) -p $(openssl passwd -1 ${var.testuser.password}) ${var.testuser.username}", "apt-get autoremove -y -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 && apt-get autoclean -y && apt-get clean -y", "rm -rf /tmp/* /var/tmp* /usr/share/doc/* /root/.ansible* /usr/share/man/* /root/.cache /etc/rsc/plugins/*", - "mkdir -p /usr/share/man/man1" # The step aboved removed all the man pages content, but this directory needs to be present as an install target for subsequent apt installs by components. + "mkdir -p /usr/share/man/man1", # The step above removed all the man pages content, but this directory needs to be present as an install target for subsequent apt installs by components. + var.extra_post_commands ] }