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

FileNotFoundError: Sandbox server didn't startup #14

Closed
anjalirai-intel opened this issue Aug 5, 2020 · 7 comments · Fixed by #17
Closed

FileNotFoundError: Sandbox server didn't startup #14

anjalirai-intel opened this issue Aug 5, 2020 · 7 comments · Fixed by #17
Labels
bug Something isn't working

Comments

@anjalirai-intel
Copy link

While creating the sandbox got following error:

sandbox = winsandbox.new_sandbox()
Traceback (most recent call last):
File "", line 1, in
File "C:\Python37\lib\site-packages\winsandbox\launch.py", line 34, in new_sandbox
return OnlineSandbox(config)
File "C:\Python37\lib\site-packages\winsandbox\sandbox.py", line 41, in init
self._connection_tuple = session.connect_to_sandbox()
File "C:\Python37\lib\site-packages\winsandbox\session\online_session.py", line 107, in connect_to_sandbox
raise FileNotFoundError("Sandbox server didn't startup")
FileNotFoundError: Sandbox server didn't startup

@thommyho
Copy link

thommyho commented Mar 4, 2021

Hi*,
the issue is the execution of the target.py script in https://github.com/karkason/pywinsandbox/blob/1316bd046b66abce8c7c565eb55cd26309585e8a/winsandbox/session/online_session.py in lines

# Launch the target script.
commands.append(r'{} -m winsandbox.target --disable-firewall {}'.format(
shared_folder_path_in_sandbox(PythonMapper().path()) / 'python.exe',
str(server_address_path)))
return 'cmd.exe /c "{}"'.format(' && '.join(commands))

The call for the remote rpc fails, because calling it like python -m winsandbox.target fails with an wmi error.

A working (but hacky) fix is the resolve the path to target.py and pass directly. This works.
I attached the file.

And virtual environments doens't seem to be working because the mapped folder is the python directory with the symlinks - This I couldn't fix - I used a normal python installation

Greetings, Thomas

online_session.zip

@Beanecessar
Copy link

Beanecessar commented Aug 19, 2022

It is seems a bug. This issue occurs when running "python.exe -m winsandbox.target" in sandbox, BUT by this way, it will import winsandbox first. When import winsandbox it will check whether or not the optional feature of windows sandboxes is enabled and absolutely failed and raise an error.
The easiest way to fix this is comment out the following code in launch.py.

# Do not allow importing if the feature isn't enabled
if 'pytest' not in sys.modules:
    verify_sandbox_feature_is_enabled()

@karkason karkason added the bug Something isn't working label Aug 30, 2022
@karkason
Copy link
Owner

I looked into this issue and it doesn't reproduce for me. In any case, in #15 I change it so I run the script manually as @thommyho suggested.

Hi*, the issue is the execution of the target.py script in https://github.com/karkason/pywinsandbox/blob/1316bd046b66abce8c7c565eb55cd26309585e8a/winsandbox/session/online_session.py in lines

# Launch the target script.
commands.append(r'{} -m winsandbox.target --disable-firewall {}'.format(
shared_folder_path_in_sandbox(PythonMapper().path()) / 'python.exe',
str(server_address_path)))
return 'cmd.exe /c "{}"'.format(' && '.join(commands))

The call for the remote rpc fails, because calling it like python -m winsandbox.target fails with an wmi error.

A working (but hacky) fix is the resolve the path to target.py and pass directly. This works. I attached the file.

And virtual environments doens't seem to be working because the mapped folder is the python directory with the symlinks - This I couldn't fix - I used a normal python installation

Greetings, Thomas

online_session.zip

Hey Thomas, thank you for your great suggestion.
In #15 I also started to support virtual environments due to your request.

@karkason
Copy link
Owner

Also - I'm very sorry for the delay! Hope fixing these issues is still relevant.

@karkason
Copy link
Owner

karkason commented Sep 1, 2022

And Version 1.3.0 just released should fix this :)
Closing this issue.

@karkason karkason closed this as completed Sep 1, 2022
@HydraDragonAntivirus
Copy link

Still same

@karkason
Copy link
Owner

Hey @HydraDragonAntivirus, I just published version v1.4.0. Can you check if the issue is fixed for you? Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants