cappsule / nofear

Run any command transparently in a VM (this repo isn't part of Cappsule)
https://cappsule.github.io/nofear/
GNU General Public License v2.0
27 stars 0 forks source link

GUI doesn't work if xpra is already running #3

Closed rsdy closed 7 years ago

rsdy commented 7 years ago

On Subgraph OS:

user@subgraph:~/Documents/nofear$ nofear --gui xclock
CPU: vendor_id 'LKVMLKVMLKVM' unknown, using generic init.
CPU: Your system may be unstable.
Warning: invalid option: 'scaling'
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
2016-12-03 01:50:07,014 
2016-12-03 01:50:07,015 Xvfb command has terminated! xpra cannot continue
2016-12-03 01:50:07,015  if the display is already running, try a different one,
2016-12-03 01:50:07,016  or use the --use-display flag
2016-12-03 01:50:07,016 
reboot: Restarting system
cappsule commented 7 years ago

Thanks for the bug report!

I think it's a permission issue. The relevant error message is: /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server. I installed Subgraph OS and nofear --gui works well if Xorg runs as root in the VM:

diff --git a/src/overlayfs.sh b/src/overlayfs.sh
index bda51a5..2c05de7 100755
--- a/src/overlayfs.sh
+++ b/src/overlayfs.sh
@@ -158,7 +158,7 @@ function main()
        bind_virt "$target"
        mount_shared_folder "$target" "$NOFEAR_SHARED"

-       run_command "$target" false $*
+       run_command "$target" true $*

        cleanup "$target"
 }

I'll try to fix this Xorg issue when I'll have some free time.

cappsule commented 7 years ago

Could you confirm that the last commit e8112d8b9b1a5ed0ff1e39dbd0ea08fdb8643339 fixes this issue? You must rebuild the filesystem and reinstall nofear with the following commands:

./build.sh filesystem
sudo ./install.sh
nofear -d default

Thanks.

rsdy commented 7 years ago

I've followed the instructions, rebuilt the filesystem, and deleted the default profile. Now nofear will just hang, but can't connect to xpra as far as I can tell. Here's the full output:

user@subgraph:~/Documents/nofear$ nofear --gui xclock
CPU: vendor_id 'LKVMLKVMLKVM' unknown, using generic init.
CPU: Your system may be unstable.
microcode: no support for this CPU vendor
Warning: invalid option: 'scaling'
2016-12-08 22:58:29,877 created unix domain socket: /home/user/.xpra/nofear-default-100
2016-12-08 22:58:31,573 Error: webcam forwarding disabled:
2016-12-08 22:58:31,573  No module named PIL
2016-12-08 22:58:31,580 Warning: webcam forwarding is disabled
2016-12-08 22:58:31,580  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2016-12-08 22:58:31,581  make sure that the 'v4l2loopback' kernel module is installed and loaded
2016-12-08 22:58:31,581 found 0 virtual video devices
2016-12-08 22:58:31,596 pulseaudio server started with pid 149
Warning: invalid option: 'scaling'
2016-12-08 22:58:32,028 GStreamer version 1.10 for Python 2.7
2016-12-08 22:58:32,115 D-Bus notification forwarding is available
2016-12-08 22:58:32,135 started command 'xclock' with pid 164
2016-12-08 22:58:32,138 xpra X11 version 0.17.6-r14322
2016-12-08 22:58:32,139  running with pid 124 on Linux
2016-12-08 22:58:32,139  on display :100
2016-12-08 22:58:32,338 xpra is ready.
2016-12-08 22:58:33,158 New unix-domain connection received on /home/user/.xpra/nofear-default-100
Failure: No such entity
Failure: No such entity
2016-12-08 22:58:43,163 connection timedout: Protocol(unix-domain socket:/home/user/.xpra/nofear-default-100)
2016-12-08 22:58:44,167 Connection lost

It is probably still a permission issue, but I don't know enough about xpra to start debugging what's going wrong. I'll be happy to follow up on this if you have any pointers.

rsdy commented 7 years ago

After clearing iptables by running systemctl stop ferm, and setting up masquerading (as per README.md), I was able to get it working this time, however, after killing the previous process with C-c, I need to wait several seconds (maybe 10-ish?) before running nofear again to get a running xclock, otherwise it just hangs. This is probably a separate issue, though. Thanks a lot!