Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland support #200

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Wayland support #200

merged 1 commit into from
Jan 28, 2024

Conversation

qu35t-code
Copy link
Member

Description

Hey @Dramelac,

Here's an addition to set the correct environment variables for wayland. I started with this observation:

docker run -it -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY debian bash
~ echo $WAYLAND_DISPLAY
wayland-1
[*] Location of the exegol workspace on the host : /home/qu35t/.exegol/workspaces/htb
[+] Opening shell in Exegol 'htb'
[-] The xhost command is not available on your host. Exegol was unable to allow your container to access your graphical environment (or you don't have one).
[Jan 26, 2024 - 21:53:47 (CET)] exegol-htb /workspace # firefox
Authorization required, but no authorization protocol specified

Error: cannot open display: :0

I've modified the code to add a check on the display server and return the correct environment variables if this is the case.
There's one step missing (and I'm struggling):

You need to add a volume:

-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY

With my modifications, the following command works: (the xhost warning must also be removed)

(venv) ➜  Exegol git:(wayland) python3 exegol.py start -V $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY wayland2
[*] Exegol is currently in version v4.3.1
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏
[+] We thank HackTheBox for sponsoring the multi-arch support 💚
[*] Starting exegol
[*] Arguments supplied with the command, skipping interactive mode

🛸 Available images
┌───────────┬─────────┬─────────────────────────┐
│ Image tag │ Size    │ Status                  │
├───────────┼─────────┼─────────────────────────┤
│ nightly   │ 50.5GB  │ Up to date (v.58d605bb) │
│ web       │ ~23.5GB │ Not installed           │
│ osint     │ ~13.3GB │ Not installed           │
│ light     │ ~14.2GB │ Not installed           │
│ full      │ ~55.3GB │ Not installed           │
│ ad        │ ~40.4GB │ Not installed           │
└───────────┴─────────┴─────────────────────────┘

[*] You can use a name that does not already exist to build a new image from local sources
[?] Select an image by its name (nightly):

⭐ Container summary
┌──────────────────┬───────────────────────────────────────────┐
│             Name │ wayland2                                  │
│            Image │ nightly - v.58d605bb (Up to date)         │
├──────────────────┼───────────────────────────────────────────┤
│      Credentials │ root : oq3PEox5VLkNHpCRulmhJL0Pay0pTI     │
│          Desktop │ Off 🪓                                    │
│              X11 │ On ✔                                      │
│          Network │ host                                      │
│         Timezone │ On ✔                                      │
│ Exegol resources │ On ✔ (/opt/resources)                     │
│     My resources │ On ✔ (/opt/my-resources)                  │
│    Shell logging │ Off 🪓                                    │
│       Privileged │ Off ✔                                     │
│        Workspace │ Dedicated (/workspace)                    │
│          Volumes │ /run/user/1000/wayland-1 ➡ /tmp/wayland-1 │
└──────────────────┴───────────────────────────────────────────┘

[*] Creating new exegol container
[+] Exegol container successfully created !
[-] The xhost command is not available on your host. Exegol was unable to allow your container to access your graphical environment (or you don't have one).
[*] Location of the exegol workspace on the host : /home/qu35t/.exegol/workspaces/wayland2
[+] Opening shell in Exegol 'wayland2'
[Jan 26, 2024 - 22:56:19 (CET)] exegol-wayland2 /workspace #
[Jan 26, 2024 - 22:57:14 (CET)] exegol-wayland2 /workspace # env|grep -i wayland
HOSTNAME=exegol-wayland2
WAYLAND_DISPLAY=wayland-1
DISPLAY=wayland-1

image

@Dramelac Dramelac self-assigned this Jan 28, 2024
@Dramelac Dramelac added the enhancement New feature or request label Jan 28, 2024
@Dramelac Dramelac changed the base branch from master to feat/wayland January 28, 2024 17:18
@Dramelac
Copy link
Member

The PR is incomplete, but it's already a very good start, and I'm taking over the rest internally on the repo.
Thank you very much!

@Dramelac Dramelac marked this pull request as ready for review January 28, 2024 17:30
@Dramelac Dramelac merged commit 6c72231 into ThePorgs:feat/wayland Jan 28, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants