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

Unable to start under mac (xhost error) #29

Closed
Yoshyn opened this issue Nov 13, 2020 · 2 comments
Closed

Unable to start under mac (xhost error) #29

Yoshyn opened this issue Nov 13, 2020 · 2 comments

Comments

@Yoshyn
Copy link

Yoshyn commented Nov 13, 2020

System configuration

os version: macOSCatalina (10.15.7)

iterm version: 3.3.12

shell: zsh 5.8 (x86_64-apple-darwin19.3.0)

Steps to reproduce

[+] Exegol image exists
[+] Exegol container exists
[+] Exegol container is up
[*] Running xhost command for display sharing
Traceback (most recent call last):
  File "/MYPATH/Exegol/exegol.py", line 603, in <module>
    globals()[options.action]()
  File "/MYPATH/Exegol/exegol.py", line 395, in start
    exec_popen(
  File "/MYPATH/Exegol/exegol.py", line 326, in exec_popen
    output = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'xhost'

Sadly the exegol --no-default start still launch xhost...

Raison :

https://support.apple.com/en-gb/HT201341

Solution :

Install xquartz (https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285)

brew install xquartz
exegol start
~ ❯❯❯ exegol start
[+] Exegol image exists
[+] Exegol container exists
[+] Exegol container is up
[*] Running xhost command for display sharing
[!] (cmd stderr)        xhost:  unable to open display "my_hostname:0"
[*] Entering Exegol
[Nov 13, 2020 - 11:51:27 (UTC)] Exegol /data #

Display sharing will still not work but at least, the project can start.

(not sure if it has to be an open issue. But as I lost 1 hours on the setup, I wanted to keep trace).

@ShutdownRepo
Copy link
Member

Thank you for this! I don't have any way of testing this on Mac so thanks for your feedback and solution
I'll this to the wiki

However, you mention that exegol --no-default start still tries to launch it with xhost but it shouldn't be the case.
I think what you're trying to do is to start it without X11 after the container has already been created.
Since the display sharing is configured at the container creation, you'd need to remove it so that it gets created again with the desired conf

$ exegol -v --no-default start
[+] Exegol image exists
[+] Exegol container exists
[+] Exegol container is up
[VERBOSE] Exegol container was created with host networking
[VERBOSE] Exegol container was created with display sharing
[*] Running xhost command for display sharing
[*] Entering Exegol

$ exegol -v reset             
[*] Exegol container exists
[*] Exegol container is up
[*] Stopping Exegol container
[+] Exegol container is down
[*] Deleting Exegol container
[+] Exegol container does not exist anymore

$ exegol -v --no-default start
[+] Exegol image exists
[-] Exegol container does not exist
[*] Creating the container
[+] Exegol container exists
[-] Exegol container is down
[*] Starting the container
[+] Exegol container is up
[*] Entering Exegol

Try this again, with -vv or -v. Do you still encounter issues? If so please paste the -vv output

You issue makes me think I could improve the error handling and exegol start. For instance, I could make the wrapper remove the container if it's unable to start ¯_(ツ)_/¯
I'll add this to the TODO.md

@ShutdownRepo
Copy link
Member

Can you please confirm the problem is fixed or supply further information on the issue?
I'm closing the issue in the mean time, feel free to re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants