From 7a97499e40f883c7657dcc97809de64a3f2999c2 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:20:11 -0400 Subject: [PATCH 1/9] added xrdp image --- tfgrid3/ubuntu_24_xrdp/.gitignore | 5 + tfgrid3/ubuntu_24_xrdp/Makefile | 10 ++ tfgrid3/ubuntu_24_xrdp/README.md | 165 ++++++++++++++++++ .../create_vm_ubuntu_xrdp_flist.sh | 136 +++++++++++++++ .../scripts/set_sudo_permissions.sh | 2 + tfgrid3/ubuntu_24_xrdp/scripts/ufw_setup.sh | 10 ++ .../ubuntu_24_xrdp/scripts/user_password.sh | 15 ++ tfgrid3/ubuntu_24_xrdp/scripts/xrdp_setup.sh | 5 + .../services/set_sudo_permissions.service | 10 ++ .../ubuntu_24_xrdp/services/ufw_setup.service | 10 ++ .../services/user_password.service | 10 ++ .../services/xrdp_setup.service | 10 ++ 12 files changed, 388 insertions(+) create mode 100644 tfgrid3/ubuntu_24_xrdp/.gitignore create mode 100644 tfgrid3/ubuntu_24_xrdp/Makefile create mode 100644 tfgrid3/ubuntu_24_xrdp/README.md create mode 100755 tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh create mode 100644 tfgrid3/ubuntu_24_xrdp/scripts/set_sudo_permissions.sh create mode 100644 tfgrid3/ubuntu_24_xrdp/scripts/ufw_setup.sh create mode 100644 tfgrid3/ubuntu_24_xrdp/scripts/user_password.sh create mode 100644 tfgrid3/ubuntu_24_xrdp/scripts/xrdp_setup.sh create mode 100644 tfgrid3/ubuntu_24_xrdp/services/set_sudo_permissions.service create mode 100644 tfgrid3/ubuntu_24_xrdp/services/ufw_setup.service create mode 100644 tfgrid3/ubuntu_24_xrdp/services/user_password.service create mode 100644 tfgrid3/ubuntu_24_xrdp/services/xrdp_setup.service diff --git a/tfgrid3/ubuntu_24_xrdp/.gitignore b/tfgrid3/ubuntu_24_xrdp/.gitignore new file mode 100644 index 00000000..165af790 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/.gitignore @@ -0,0 +1,5 @@ +/ubuntu-noble +/logs +wget-log +*.tar.gz +ubuntu-24.04_vm_xrdp.tar.gz \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/Makefile b/tfgrid3/ubuntu_24_xrdp/Makefile new file mode 100644 index 00000000..da78a7ac --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/Makefile @@ -0,0 +1,10 @@ +build: + @echo "Please enter your API key:" + @read -p "API Key: " api_key; \ + chmod +x create_vm_ubuntu_xrdp_flist.sh; \ + sudo ./create_vm_ubuntu_xrdp_flist.sh "$$api_key" + +delete: + sudo rm -rf ubuntu-noble + sudo rm -rf logs + sudo rm ubuntu-24.04_vm_xrdp.tar.gz \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md new file mode 100644 index 00000000..d15a0b44 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -0,0 +1,165 @@ +

Ubuntu XRDP VM Flist Creator

+ +

Table of Contents

+ +- [Introduction](#introduction) +- [Prerequisites](#prerequisites) +- [Usage](#usage) + - [Manual Method](#manual-method) + - [Using Makefile](#using-makefile) +- [What the Script Does](#what-the-script-does) +- [Notes](#notes) +- [Troubleshooting](#troubleshooting) +- [Clean Up](#clean-up) +- [Server Side: Dashboard Deployment](#server-side-dashboard-deployment) +- [Client Side: Install Remote Desktop Connection for Windows, MAC or Linux](#client-side-install-remote-desktop-connection-for-windows-mac-or-linux) + - [Download the App](#download-the-app) + - [Connect Remotely](#connect-remotely) +- [Conclusion](#conclusion) +- [License](#license) + +--- + +## Introduction + +This directory contains a script to create a VM flist with Ubuntu and XRDP for the ThreeFold Grid. The flist includes a desktop environment (XFCE) and XRDP, allowing for remote desktop access to your deployed VM. + +## Prerequisites + +- A Linux system with root access +- Sufficient disk space (at least 10GB free) +- A ThreeFold ZOS Hub account with an API key +- `make` utility installed on your system (optional, for Makefile method) + +## Usage + +### Manual Method + +1. Clone this repository: + ``` + git clone https://github.com/threefoldtech/tf-images + cd ./tf-images/tfgrid3/ubuntu_xrdp_vm_flist + ``` + +2. Make the script executable: + ``` + chmod +x create_vm_ubuntu_xrdp_flist.sh + ``` + +3. Run the script with sudo privileges, providing your ThreeFold ZOS Hub API key as an argument: + ``` + sudo ./create_vm_ubuntu_xrdp_flist.sh YOUR_API_KEY_HERE + ``` + Replace `YOUR_API_KEY_HERE` with your actual ThreeFold Hub API key. + +### Using Makefile + +1. Clone this repository: + ``` + git clone https://github.com/threefoldtech/tf-images + cd ./tf-images/tfgrid3/ubuntu_xrdp_vm_flist + ``` + +2. Run the build command using make: + ``` + make build + ``` + +3. When prompted, enter your ThreeFold ZOS Hub API key. + +4. Wait for the script to complete. This may take some time depending on your internet connection and system performance. + +5. Once completed, the script will have created and uploaded an flist named `ubuntu-24.04_vm_xrdp.tar.gz` to your ThreeFold Hub account. + +## What the Script Does + +1. Installs necessary packages +2. Creates a base Ubuntu system using debootstrap +3. Installs XFCE desktop environment and XRDP +4. Configures a non-root user for XRDP access +5. Sets up firewall rules +6. Creates and uploads the flist to the ThreeFold Hub + +## Notes + +- The default non-root user created is `xrdpuser` with password `xrdppassword`. It's recommended to change this password after first login. + - Simply set the variable PASSWORD="your password here" when deploying the VM on the Dashboard + - You can also update your password with the command `sudo passwd` on the VM +- The script requires an active internet connection throughout its execution. +- Ensure you have the latest version of the script by pulling from this repository before each use. + +## Troubleshooting + +If you encounter any issues: +1. Check your internet connection +2. Ensure you have sufficient disk space +3. Verify that you're using a valid ThreeFold API key +4. Review the script output for any error messages + +For persistent issues, please open an issue in this GitHub repository. + +## Clean Up + +To remove the created files after running the script, you can use either of the following methods: + +Manual method: +``` +sudo rm -rf ubuntu-noble +sudo rm ubuntu-24.04_vm_xrdp.tar.gz +sudo rm -rf logs +``` + +Using Makefile: +``` +make delete +``` + +Both methods will remove the `ubuntu-noble` directory, the `ubuntu-24.04_vm_xrdp.tar.gz` file, and the `logs` directory. + +## Server Side: Dashboard Deployment + +Once the Flist is set, deploy it on the Dashboard via the Micro VM page. + +- Go to Micro VM page +- Under `VM Image`, select ̀`Other` and insert the Flist URL +- Under `Entry Point`, make sure nothing is written +- Open the `Environment Variables` windows and set the environment variables: + - Name: LOCALIP + - Value: The local PC IP you're using + - You can use `curl ifconfig.me` to see your public IP address + - Name: PASSWORD + - Value: The password you want for your xrdp user +- Choose a node and click `Deploy` + +## Client Side: Install Remote Desktop Connection for Windows, MAC or Linux + +For the client side (the local computer accessing the VM remotely), you can use remote desktop connection for Windows, MAC and Linux. The process is very similar in all three cases. + +Simply download the app, open it and write the IPv4 address of the VM. You then will need to write the username and password to enter into your VM. + +### Download the App + +* Client side Remote app + * Windows + * [Remote Desktop Connection app](https://apps.microsoft.com/store/detail/microsoft-remote-desktop/9WZDNCRFJ3PS?hl=en-ca&gl=ca&rtc=1) + * MAC + * Download in app store + * [Microsoft Remote Desktop Connection app](https://apps.apple.com/ca/app/microsoft-remote-desktop/id1295203466?mt=12) + * Linux + * [Remmina RDP Client](https://remmina.org/) + +### Connect Remotely + +* General process + * In the Remote app, enter the following: + * the IPv4 Address of the VM + * the VM root-access username and password + * You now have remote desktop connection to your VM + +## Conclusion + +You now have a remote access to the desktop environment of your VM. + +## License + +This work is under the [Apache 2.0 license](./LICENSE). \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh b/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh new file mode 100755 index 00000000..acffce8e --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh @@ -0,0 +1,136 @@ +#!/bin/bash + +# Ensure the script is run as root +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root" >&2 + exit 1 +fi + +# Check if API_KEY provided or not +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 2 +fi + +API_KEY=$1 + +mkdir -p ./logs + +# Function to log messages with timestamps +log_message() { + echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a ./logs/setup.log +} + +log_message "Starting script execution" +log_message "Installing arch-install-scripts package..." +apt-get update +apt-get install arch-install-scripts debootstrap -y + +log_message "Starting debootstrap..." +mkdir -p ubuntu-noble + +debootstrap noble ubuntu-noble http://archive.ubuntu.com/ubuntu +log_message "Debootstrap completed." + +log_message "Preparing chroot environment script..." +cat <<'EOF' > ubuntu-noble/root/setup_inside_chroot.sh +#!/bin/bash +set -x # This will print each command before it's executed +export PATH=/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin:/bin + +echo "Starting setup inside chroot" + +# Pre-configure tzdata +echo "tzdata tzdata/Areas select Etc" | debconf-set-selections +echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections + +# Set timezone to UTC +ln -fs /usr/share/zoneinfo/UTC /etc/localtime +dpkg-reconfigure -f noninteractive tzdata + +echo "Configuring DNS..." +rm /etc/resolv.conf +echo 'nameserver 1.1.1.1' > /etc/resolv.conf + +echo "Updating package lists..." +apt-get update -y || echo "ERROR: Failed to update package lists" + +echo "Installing initial packages..." +apt-get install -y cloud-init openssh-server curl initramfs-tools ufw || echo "ERROR: Failed to install initial packages" + +echo "Cleaning cloud-init..." +cloud-init clean + +echo "Installing extra kernel modules..." +apt-get install linux-virtual -y || echo "ERROR: Failed to install extra kernel modules" + +echo "Configuring initramfs..." +echo 'fs-virtiofs' >> /etc/initramfs-tools/modules +update-initramfs -c -k all + +# Install XFCE and XRDP +echo "Installing XFCE and XRDP..." +DEBIAN_FRONTEND=noninteractive add-apt-repository -y universe +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4 xfce4-goodies xrdp sudo || echo "ERROR: Failed to install xrdp" + +# Create a non-root user for XRDP +echo "Creating non-root user for XRDP..." +useradd -m -s /bin/bash xrdpuser +echo "xrdpuser:xrdppassword" | chpasswd +usermod -aG sudo xrdpuser + +# Configure XRDP for the new user +echo "Configuring XRDP for the new user..." +echo "xfce4-session" > /home/xrdpuser/.xsession +chown xrdpuser:xrdpuser /home/xrdpuser/.xsession + +# Configure XRDP +echo "Configuring XRDP..." +sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config +systemctl enable xrdp || echo "WARNING: Failed to enable XRDP service" + +echo "Cleaning up packages..." +apt-get clean + +# Set correct ownership and permissions for sudo +echo "Setting sudo permissions..." +chown root:root /usr/bin/sudo +chmod 4755 /usr/bin/sudo + +echo "Setting execute permissions for custom scripts..." +chmod +x /usr/local/bin/* + +# Enable the services +echo "Enabling custom services..." +systemctl enable set_sudo_permissions.service || echo "WARNING: Failed to enable set_sudo_permissions service" +systemctl enable user_password.service || echo "WARNING: Failed to enable user_password service" +systemctl enable ufw_setup.service || echo "WARNING: Failed to enable ufw_setup service" +systemctl enable xrdp_setup.service || echo "WARNING: Failed to enable xrdp_setup service" + +echo "Chroot setup completed" +EOF + +chmod +x ubuntu-noble/root/setup_inside_chroot.sh + +log_message "Copying services and scripts into the VM..." +cp ./services/* ubuntu-noble/etc/systemd/system/ 2>/dev/null || log_message "WARNING: Could not copy service files" +cp ./scripts/* ubuntu-noble/usr/local/bin/ 2>/dev/null || log_message "WARNING: Could not copy script files" + +log_message "Entering chroot environment..." +arch-chroot ubuntu-noble /root/setup_inside_chroot.sh 2>&1 | tee -a ./logs/chroot_setup.log +log_message "Chroot setup completed." + +log_message "Cleaning up..." +rm ubuntu-noble/root/setup_inside_chroot.sh +rm -rf ubuntu-noble/dev/* + +log_message "Creating tar archive..." +tar -czvf ubuntu-24.04_vm_xrdp.tar.gz -C ubuntu-noble . +log_message "Tar archive created." + +log_message "Uploading to Threefold Hub..." +curl -v -X POST -H "Authorization: Bearer $API_KEY" -F "file=@ubuntu-24.04_vm_xrdp.tar.gz" https://hub.grid.tf/api/flist/me/upload +log_message "Upload completed." + +log_message "Script execution completed" \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/scripts/set_sudo_permissions.sh b/tfgrid3/ubuntu_24_xrdp/scripts/set_sudo_permissions.sh new file mode 100644 index 00000000..9db64a61 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/scripts/set_sudo_permissions.sh @@ -0,0 +1,2 @@ +#!/bin/bash +/bin/chown root:root /usr/bin/sudo && /bin/chmod 4755 /usr/bin/sudo \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/scripts/ufw_setup.sh b/tfgrid3/ubuntu_24_xrdp/scripts/ufw_setup.sh new file mode 100644 index 00000000..c54aecf7 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/scripts/ufw_setup.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mount /dev/vda /mnt +source /mnt/zosrc +ufw default deny incoming +ufw default allow outgoing +ufw allow ssh +ufw allow from ${LOCALIP}/32 to any port 3389 +ufw limit ssh +ufw --force enable \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/scripts/user_password.sh b/tfgrid3/ubuntu_24_xrdp/scripts/user_password.sh new file mode 100644 index 00000000..b0e6047c --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/scripts/user_password.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Mount the device (requires root privileges) +mount /dev/vda /mnt + +# Source the file (make sure it exists) +source /mnt/zosrc + +# Only change password if PASSWORD is set +if [ -n "${PASSWORD}" ]; then + echo "Changing the password..." + echo "xrdpuser:${PASSWORD}" | chpasswd +else + echo "PASSWORD not set. Skipping password change." +fi \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/scripts/xrdp_setup.sh b/tfgrid3/ubuntu_24_xrdp/scripts/xrdp_setup.sh new file mode 100644 index 00000000..c6a7e5d6 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/scripts/xrdp_setup.sh @@ -0,0 +1,5 @@ +#!/bin/bash +systemctl start xrdp +cd ~ +echo "xfce4-session" | tee .xsession +systemctl restart xrdp \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/services/set_sudo_permissions.service b/tfgrid3/ubuntu_24_xrdp/services/set_sudo_permissions.service new file mode 100644 index 00000000..0406e109 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/services/set_sudo_permissions.service @@ -0,0 +1,10 @@ +[Unit] +Description=Set correct ownership and permissions for sudo +Before=ssh.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/set_sudo_permissions.sh + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/services/ufw_setup.service b/tfgrid3/ubuntu_24_xrdp/services/ufw_setup.service new file mode 100644 index 00000000..fecddf0c --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/services/ufw_setup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Set firewall +Before=ssh.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/ufw_setup.sh + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/services/user_password.service b/tfgrid3/ubuntu_24_xrdp/services/user_password.service new file mode 100644 index 00000000..4fd14f72 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/services/user_password.service @@ -0,0 +1,10 @@ +[Unit] +Description=Set new password +Before=ssh.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/user_password.sh + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tfgrid3/ubuntu_24_xrdp/services/xrdp_setup.service b/tfgrid3/ubuntu_24_xrdp/services/xrdp_setup.service new file mode 100644 index 00000000..33caea03 --- /dev/null +++ b/tfgrid3/ubuntu_24_xrdp/services/xrdp_setup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Set XRDP +After=ufw_setup.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/xrdp_setup.sh + +[Install] +WantedBy=multi-user.target \ No newline at end of file From 7657f28accb7bee33eebfdf8df7ce3b00cb06f28 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:22:09 -0400 Subject: [PATCH 2/9] changed dir name in readme --- tfgrid3/ubuntu_24_xrdp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index d15a0b44..74bad6a8 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -38,7 +38,7 @@ This directory contains a script to create a VM flist with Ubuntu and XRDP for t 1. Clone this repository: ``` git clone https://github.com/threefoldtech/tf-images - cd ./tf-images/tfgrid3/ubuntu_xrdp_vm_flist + cd ./tf-images/tfgrid3/ubuntu_24_xrdp ``` 2. Make the script executable: @@ -57,7 +57,7 @@ This directory contains a script to create a VM flist with Ubuntu and XRDP for t 1. Clone this repository: ``` git clone https://github.com/threefoldtech/tf-images - cd ./tf-images/tfgrid3/ubuntu_xrdp_vm_flist + cd ./tf-images/tfgrid3/ubuntu_24_xrdp ``` 2. Run the build command using make: From b81dbf0f5f72711a48db153fdfc8cfec59a7a8a7 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:23:13 -0400 Subject: [PATCH 3/9] added wget-log in gitignore --- tfgrid3/ubuntu_24_xrdp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tfgrid3/ubuntu_24_xrdp/Makefile b/tfgrid3/ubuntu_24_xrdp/Makefile index da78a7ac..ed33128c 100644 --- a/tfgrid3/ubuntu_24_xrdp/Makefile +++ b/tfgrid3/ubuntu_24_xrdp/Makefile @@ -7,4 +7,5 @@ build: delete: sudo rm -rf ubuntu-noble sudo rm -rf logs + sudo rm -rf wget-log sudo rm ubuntu-24.04_vm_xrdp.tar.gz \ No newline at end of file From 19cba601bb3226eabdf68b9b88ae139cbd64ff04 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:24:09 -0400 Subject: [PATCH 4/9] simplified license link in readme --- tfgrid3/ubuntu_24_xrdp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index 74bad6a8..99769312 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -162,4 +162,4 @@ You now have a remote access to the desktop environment of your VM. ## License -This work is under the [Apache 2.0 license](./LICENSE). \ No newline at end of file +This work is under the Apache 2.0 license. \ No newline at end of file From 70243524313871f60980dd48e5cd02039cfaac0a Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:27:17 -0400 Subject: [PATCH 5/9] updated readme --- tfgrid3/ubuntu_24_xrdp/README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index 99769312..1c3732b0 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -15,7 +15,6 @@ - [Client Side: Install Remote Desktop Connection for Windows, MAC or Linux](#client-side-install-remote-desktop-connection-for-windows-mac-or-linux) - [Download the App](#download-the-app) - [Connect Remotely](#connect-remotely) -- [Conclusion](#conclusion) - [License](#license) --- @@ -28,7 +27,7 @@ This directory contains a script to create a VM flist with Ubuntu and XRDP for t - A Linux system with root access - Sufficient disk space (at least 10GB free) -- A ThreeFold ZOS Hub account with an API key +- A [ThreeFold ZOS Hub](https://manual.grid.tf/documentation/developers/flist/flist_hub/zos_hub.html) account with an API key - `make` utility installed on your system (optional, for Makefile method) ## Usage @@ -46,7 +45,7 @@ This directory contains a script to create a VM flist with Ubuntu and XRDP for t chmod +x create_vm_ubuntu_xrdp_flist.sh ``` -3. Run the script with sudo privileges, providing your ThreeFold ZOS Hub API key as an argument: +3. Run the script with sudo privileges, providing your [ThreeFold ZOS Hub API key](https://manual.grid.tf/documentation/developers/flist/flist_hub/api_token.html) as an argument: ``` sudo ./create_vm_ubuntu_xrdp_flist.sh YOUR_API_KEY_HERE ``` @@ -120,16 +119,16 @@ Both methods will remove the `ubuntu-noble` directory, the `ubuntu-24.04_vm_xrdp Once the Flist is set, deploy it on the Dashboard via the Micro VM page. -- Go to Micro VM page +- Go to the Micro VM page - Under `VM Image`, select ̀`Other` and insert the Flist URL -- Under `Entry Point`, make sure nothing is written +- Under `Entry Point`, make sure that nothing is written - Open the `Environment Variables` windows and set the environment variables: - Name: LOCALIP - Value: The local PC IP you're using - You can use `curl ifconfig.me` to see your public IP address - Name: PASSWORD - Value: The password you want for your xrdp user -- Choose a node and click `Deploy` +- Choose a node with IPv4 network and click `Deploy` ## Client Side: Install Remote Desktop Connection for Windows, MAC or Linux @@ -156,10 +155,6 @@ Simply download the app, open it and write the IPv4 address of the VM. You then * the VM root-access username and password * You now have remote desktop connection to your VM -## Conclusion - -You now have a remote access to the desktop environment of your VM. - ## License This work is under the Apache 2.0 license. \ No newline at end of file From 4bc1463bbee8d324b5bc6fc5346e01f9bdd83447 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:29:43 -0400 Subject: [PATCH 6/9] updated readme with makefile steps manual --- tfgrid3/ubuntu_24_xrdp/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index 1c3732b0..9bbb43ed 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -101,14 +101,15 @@ For persistent issues, please open an issue in this GitHub repository. To remove the created files after running the script, you can use either of the following methods: -Manual method: +- Manual method: ``` sudo rm -rf ubuntu-noble -sudo rm ubuntu-24.04_vm_xrdp.tar.gz sudo rm -rf logs +sudo rm -rf wget-log +sudo rm ubuntu-24.04_vm_xrdp.tar.gz ``` -Using Makefile: +- Using Makefile: ``` make delete ``` From b8bcfcbc066a1864785900afb5e8b717a31e9528 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 11:30:13 -0400 Subject: [PATCH 7/9] readme update for xrdp --- tfgrid3/ubuntu_24_xrdp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index 9bbb43ed..13677852 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -114,7 +114,7 @@ sudo rm ubuntu-24.04_vm_xrdp.tar.gz make delete ``` -Both methods will remove the `ubuntu-noble` directory, the `ubuntu-24.04_vm_xrdp.tar.gz` file, and the `logs` directory. +Both methods will remove the `ubuntu-noble` directory, the `ubuntu-24.04_vm_xrdp.tar.gz` file, and the `logs`. ## Server Side: Dashboard Deployment From 9bfafccf5a1a1845c95c1d52c4eef40a0eeb0295 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 23 Oct 2024 13:25:57 -0400 Subject: [PATCH 8/9] removed verbose from tar for easier log message --- tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh b/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh index acffce8e..be21db71 100755 --- a/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh +++ b/tfgrid3/ubuntu_24_xrdp/create_vm_ubuntu_xrdp_flist.sh @@ -126,7 +126,7 @@ rm ubuntu-noble/root/setup_inside_chroot.sh rm -rf ubuntu-noble/dev/* log_message "Creating tar archive..." -tar -czvf ubuntu-24.04_vm_xrdp.tar.gz -C ubuntu-noble . +tar -czf ubuntu-24.04_vm_xrdp.tar.gz -C ubuntu-noble . log_message "Tar archive created." log_message "Uploading to Threefold Hub..." From 1de97ed5b369d18e80aa9a9f75986ecde01d6cbf Mon Sep 17 00:00:00 2001 From: mik-tf Date: Wed, 13 Nov 2024 11:39:46 -0500 Subject: [PATCH 9/9] added disclaimer that it is not official flist --- tfgrid3/ubuntu_24_xrdp/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tfgrid3/ubuntu_24_xrdp/README.md b/tfgrid3/ubuntu_24_xrdp/README.md index 13677852..8230342a 100644 --- a/tfgrid3/ubuntu_24_xrdp/README.md +++ b/tfgrid3/ubuntu_24_xrdp/README.md @@ -23,6 +23,8 @@ This directory contains a script to create a VM flist with Ubuntu and XRDP for the ThreeFold Grid. The flist includes a desktop environment (XFCE) and XRDP, allowing for remote desktop access to your deployed VM. +> Note: This is not an officially supported flist. You can use it as a guide to build your own. + ## Prerequisites - A Linux system with root access