|
1 | 1 | --- |
2 | | -display_name: Rustdesk |
3 | | -description: Create desktop environment & run rustdesk in your workspace |
| 2 | +display_name: RustDesk |
| 3 | +description: Create a desktop environment and run RustDesk in your workspace |
4 | 4 | icon: ../../../../.icons/rustdesk.svg |
5 | 5 | verified: false |
6 | 6 | tags: [rustdesk, rdp, vm] |
7 | 7 | --- |
8 | 8 |
|
9 | | -# RustDesk Coder Module |
| 9 | +# RustDesk |
10 | 10 |
|
11 | | -This is the basic Coder's rustdesk module that installs minimal desktop environment (xfce) & launches the rustdesk within your workspace |
| 11 | +Installs a minimal desktop environment (XFCE) and launches RustDesk within your workspace to provide remote desktop access. The module outputs the RustDesk ID and password needed to connect from external RustDesk clients. |
12 | 12 |
|
13 | | ---- |
| 13 | +```tf |
| 14 | +module "rustdesk" { |
| 15 | + count = data.coder_workspace.me.start_count |
| 16 | + source = "registry.coder.com/BenraouaneSoufiane/rustdesk/coder" |
| 17 | + version = "1.0.0" |
| 18 | + agent_id = coder_agent.example.id |
| 19 | +} |
| 20 | +``` |
14 | 21 |
|
15 | 22 | ## Features |
16 | 23 |
|
17 | | -- Installs RustDesk & launches it in GUI not with black screen |
18 | | -- Outputs the RustDesk ID and password |
19 | | -- Automatically launches RustDesk on workspace start |
20 | | -- Provides an external app link to the [RustDesk web client](https://rustdesk.com/web) |
21 | | - |
22 | | ---- |
23 | | - |
24 | | -## Usage |
| 24 | +- Automatically installs XFCE desktop environment |
| 25 | +- Downloads and configures RustDesk |
| 26 | +- Outputs RustDesk ID and password for easy connection |
| 27 | +- Provides external app link to RustDesk web client for browser-based access |
| 28 | +- Starts virtual display (Xvfb) with customizable resolution |
| 29 | +- Customizable screen resolution and RustDesk version |
25 | 30 |
|
26 | | -### Prerequisites |
| 31 | +## Requirements |
27 | 32 |
|
28 | 33 | - Coder v2.5 or higher |
29 | | -- A workspace agent compatible with Linux and `apt` package manager |
30 | | -- Root scope (to install desktop environment, rustdesk & execute rustdesk --password "somepassword", because rustdesk cli does not provide a way to get the password else setup in advance, the command rustdesk --password "somepassword" only for root users) |
31 | | - |
32 | | ---- |
| 34 | +- Linux workspace with `apt`, `dnf`, or `yum` package manager |
| 35 | +- Root privileges (required for desktop environment installation and RustDesk password configuration) |
33 | 36 |
|
34 | | -### Quickstart |
| 37 | +## Examples |
35 | 38 |
|
36 | | -1. Add the module to your [Coder Terraform workspace](https://registry.coder.com) |
37 | | -2. Include it in your `main.tf`: |
| 39 | +### Basic setup |
38 | 40 |
|
39 | 41 | ```tf |
40 | 42 | module "rustdesk" { |
41 | | - source = "registry.coder.com/BenraouaneSoufiane/rustdesk/BenraouaneSoufiane" |
42 | | - agent_id = var.agent_id |
| 43 | + count = data.coder_workspace.me.start_count |
| 44 | + source = "registry.coder.com/BenraouaneSoufiane/rustdesk/coder" |
| 45 | + version = "1.0.0" |
| 46 | + agent_id = coder_agent.example.id |
43 | 47 | } |
44 | 48 | ``` |
45 | 49 |
|
46 | | -Also add this within resource "docker_container" "workspace": |
| 50 | +### Custom configuration |
47 | 51 |
|
48 | 52 | ```tf |
49 | | -privileged = true |
50 | | -user = "root" |
51 | | -network_mode = "host" |
52 | | -ports { |
53 | | - internal = 21115 |
54 | | - external = 21115 |
55 | | -} |
56 | | -ports { |
57 | | - internal = 21116 |
58 | | - external = 21116 |
59 | | -} |
60 | | -ports { |
61 | | - internal = 21118 |
62 | | - external = 21118 |
63 | | -} |
64 | | -ports { |
65 | | - internal = 21119 |
66 | | - external = 21119 |
| 53 | +module "rustdesk" { |
| 54 | + count = data.coder_workspace.me.start_count |
| 55 | + source = "registry.coder.com/BenraouaneSoufiane/rustdesk/coder" |
| 56 | + version = "1.0.0" |
| 57 | + agent_id = coder_agent.example.id |
| 58 | + rustdesk_password = "mycustompass" |
| 59 | + xvfb_resolution = "1920x1080x24" |
| 60 | + rustdesk_version = "1.4.0" |
67 | 61 | } |
68 | 62 | ``` |
69 | 63 |
|
70 | | -Also you can customize the rustdesk version, virtual screen dimensions & the pass |
| 64 | +### Docker container configuration |
| 65 | + |
| 66 | +When using with Docker, add the following to your `docker_container` resource: |
71 | 67 |
|
72 | 68 | ```tf |
73 | | -module "rustdesk" { |
74 | | - source = "registry.coder.com/BenraouaneSoufiane/rustdesk/BenraouaneSoufiane" |
75 | | - agent_id = var.agent_id |
76 | | - rustdesk_password = "mycustompass" |
77 | | - xvfb_resolution = "1920x1080x24" |
78 | | - rustdesk_version = "1.4.0" |
| 69 | +resource "docker_container" "workspace" { |
| 70 | + # ... other configuration ... |
| 71 | + |
| 72 | + privileged = true |
| 73 | + user = "root" |
| 74 | + network_mode = "host" |
| 75 | + |
| 76 | + ports { |
| 77 | + internal = 21115 |
| 78 | + external = 21115 |
| 79 | + } |
| 80 | + ports { |
| 81 | + internal = 21116 |
| 82 | + external = 21116 |
| 83 | + } |
| 84 | + ports { |
| 85 | + internal = 21118 |
| 86 | + external = 21118 |
| 87 | + } |
| 88 | + ports { |
| 89 | + internal = 21119 |
| 90 | + external = 21119 |
| 91 | + } |
79 | 92 | } |
80 | 93 | ``` |
| 94 | + |
0 commit comments