Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for starting gnome-terminal in a DispVM #2581
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
Jan 15, 2017
Member
This is because gnome-terminal is a stub that calls gnome-terminal-server to open a new window and then exits. Because the command you have called exits, the dispVM closes. It's expected behaviour.
|
This is because gnome-terminal is a stub that calls gnome-terminal-server to open a new window and then exits. Because the command you have called exits, the dispVM closes. It's expected behaviour. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 15, 2017
Member
|
And this is also the reason why in default configuration there is xterm
used, instead of gnome-terminal...
…--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
maxsu
Jan 15, 2017
Thanks unman, I've verified that this is indeed what's going on. I found some more details in the second answer @here, and in the debugging instructions here.
Despite the technical difficulty, I think a user should reasonably be able to use gnome-terminal from a disp-VM. I've cobbled together a rather ugly solution:
sh -c 'echo /usr/libexec/gnome-terminal-server --app-id my.qubes.Terminal \& sleep 2 \&\& gnome-terminal --app-id my.qubes.Terminal | /usr/lib/qubes/qfile-daemon-dvm qubes.VMShell dom0 DEFAULT red'
I've tested this solution and it works to create a persistent gnome-terminal window. Additionally it correctly shuts down the dispVM once the last visible terminal window is destroyed (similar to the DispVM: Firefox use case), as this causes the gnome-terminal-server process to be destroyed.
I'm not entirely satisfied with this solution:
- If gnome-terminal-server is slow to start for some reason (or if we remove the
sleepinvocation), we get anError creating terminal: The name my.qubes.Terminal was not provided by any .service files - If a malicious process is able to persist the gnome-terminal-server beyond the point where all visible terminal windows have been closed, this would prevent shutdown of the dispvm, which might escape the attention of the user.
Since a process running in the shell could conceivably create a dummy display and send a terminal window to that display, item 2 seems like a risk that might not happen in the firefox case (where as far as I know firefox cannot simply execute arbitrary code in a privileged shell).
maxsu
commented
Jan 15, 2017
•
|
Thanks unman, I've verified that this is indeed what's going on. I found some more details in the second answer @here, and in the debugging instructions here. Despite the technical difficulty, I think a user should reasonably be able to use gnome-terminal from a disp-VM. I've cobbled together a rather ugly solution:
I've tested this solution and it works to create a persistent gnome-terminal window. Additionally it correctly shuts down the dispVM once the last visible terminal window is destroyed (similar to the DispVM: Firefox use case), as this causes the gnome-terminal-server process to be destroyed. I'm not entirely satisfied with this solution:
Since a process running in the shell could conceivably create a dummy display and send a terminal window to that display, item 2 seems like a risk that might not happen in the firefox case (where as far as I know firefox cannot simply execute arbitrary code in a privileged shell). |
andrewdavidwong
changed the title from
Unable to start Gnome-Terminal in a DispVM
to
Add support for starting gnome-terminal in a DispVM
Jan 15, 2017
andrewdavidwong
added
C: other
enhancement
help wanted
P: minor
labels
Jan 15, 2017
andrewdavidwong
added this to the Far in the future milestone
Jan 15, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Feb 23, 2017
Contributor
- If a malicious process is able to persist the gnome-terminal-server beyond the point where all visible terminal windows have been closed, this would prevent shutdown of the dispvm, which might escape the attention of the user.
This is not unique to gnome-terminal-server. For attacker-controlled DispVMs, there is no trusted correlation between all windows being closed and a DispVM being shut down. This is true irrespective of the initial program started.
This is not unique to gnome-terminal-server. For attacker-controlled DispVMs, there is no trusted correlation between all windows being closed and a DispVM being shut down. This is true irrespective of the initial program started. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewclausen
Jan 18, 2018
I think I have a systemd solution for this problem:
qvm-run '$dispvm' "gnome-terminal; systemctl --user start gnome-terminal-server --wait"
P.S. Sorry for spamming the mailing list. I should have checked here first.
andrewclausen
commented
Jan 18, 2018
|
I think I have a systemd solution for this problem:
P.S. Sorry for spamming the mailing list. I should have checked here first. |
maxsu commentedJan 14, 2017
•
edited
Edited 1 time
-
maxsu
edited Jan 14, 2017 (most recent)
I've come across a curious little issue.
Qubes OS version (e.g.,
R3.2):R3.2
Affected TemplateVMs (e.g.,
fedora-23, if applicable):DispVM
Expected behavior:
The following command should start a DispVM and produce a working gnome-terminal, and allow the creation of a launcher for gnome terminal, similar to
DispVM: xterm:Actual behavior:
The DispVM starts up and gnome-terminal may appear momentarily. If the terminal appears, it immediately terminates. After a moment the DispVM shuts down.
Dom0 terminal shows:
The command finishes approximately 3 seconds after the last entry.
Steps to reproduce the behavior:
Execute the above command either in a dom0 shell or via a customized version of the 'xfce DispVM: xterm' launcher.
General notes:
I've used the
qfile-daemon-dvmcommand to successfully launch other non-standard apps including theurxvtterminal and thenautilus,gedit, andgnome-calculatorapps. I can successfully spawn gnome-terminal by using DispVM: xterm, and by using Qubes VM Manager's 'Run command in VM' dialog for an existing dispVM. Another person has been able to replicate the issue in their Qubes R3.2 environment.