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 up(feature suggestion) shared folders (perhaps over qrexec?) #2826
Comments
andrewdavidwong
added
C: core
enhancement
labels
May 21, 2017
andrewdavidwong
added this to the Far in the future milestone
May 21, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cyrinux
May 22, 2017
Hi,
What about this?
https://groups.google.com/forum/m/#!topic/qubes-devel/rCc20BTZ9co
cyrinux
commented
May 22, 2017
|
Hi, https://groups.google.com/forum/m/#!topic/qubes-devel/rCc20BTZ9co |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tonsimple
May 22, 2017
@cyrinux
Thanks!
Looks interesting.
Though comments by Vít Šesták (particularly about inode number guessing) worry me a mite.
Also, I don't quite understand what "The home directory of the destvm should be readonly accessible in the given directory in the srcvm" means, I guess I'll ask in that project's github issues.
tonsimple
commented
May 22, 2017
|
@cyrinux Also, I don't quite understand what "The home directory of the destvm should be readonly accessible in the given directory in the srcvm" means, I guess I'll ask in that project's github issues. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
May 24, 2017
Contributor
Can you help me understand the intended use case?
"Shared folders" in every way I've seen implemented are dangerous to some degree (in any case more than qvm-copy/move-to-vm), so I'm curious if perhaps the root motivation can be satisfied in another manner. I really don't see what purpose it serves, but you're not the first one to ask for this or hack together a solution, so there must be something I'm not seeing...
|
Can you help me understand the intended use case? "Shared folders" in every way I've seen implemented are dangerous to some degree (in any case more than qvm-copy/move-to-vm), so I'm curious if perhaps the root motivation can be satisfied in another manner. I really don't see what purpose it serves, but you're not the first one to ask for this or hack together a solution, so there must be something I'm not seeing... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
May 24, 2017
Member
Does https://www.qubes-os.org/doc/copying-files/ work for you?
Otherwise, let me throw in a big hack. Perhaps ssh over qrexec and then using sshfs.
|
Does https://www.qubes-os.org/doc/copying-files/ work for you? Otherwise, let me throw in a big hack. Perhaps ssh over qrexec and then using sshfs. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tonsimple
May 30, 2017
@jpouellet
Say you're downloading a large (like, 4 TB large) file (torrent or whatever) and you can't commit 4TB both to VM that is "internet-facing" and the VM that is supposed to store/process/etc the file.
Right now I'm doing a samba share, but samba is hugely unpleasant in ways I outlined in original post.
I realize that shared folders add attack surface and complexity no matter how you slice them.
But I would prefer things that add less of that than "a dedicated SMB server"
@adrelanos
Technically copying files would work if I could commit enough storage to both the VM that "does the downloading" and the VM that is "supposed to eventually handle/process/etc. the file"
SSHFS is definitely a viable alternative at least in the sense that it's probably less complex than a "fully grown" SMB, but point 3 and to some extent point 1 from my original post would still stand.
Ideally, the shared folder solution would not need to have the "host VM" (source of share) and "destination vm" (the machine to which the folder is shared) to have same proxyvm/firewallVM (so that the machine doing the "processing" of the file could be left with no "proper networking" beyond the single folder share)
tonsimple
commented
May 30, 2017
|
@jpouellet Right now I'm doing a samba share, but samba is hugely unpleasant in ways I outlined in original post. I realize that shared folders add attack surface and complexity no matter how you slice them. @adrelanos SSHFS is definitely a viable alternative at least in the sense that it's probably less complex than a "fully grown" SMB, but point 3 and to some extent point 1 from my original post would still stand. Ideally, the shared folder solution would not need to have the "host VM" (source of share) and "destination vm" (the machine to which the folder is shared) to have same proxyvm/firewallVM (so that the machine doing the "processing" of the file could be left with no "proper networking" beyond the single folder share) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
May 30, 2017
Contributor
Ideally, the shared folder solution would not need to have the "host VM" (source of share) and "destination vm" (the machine to which the folder is shared) to have same proxyvm/firewallVM (so that the machine doing the "processing" of the file could be left with no "proper networking" beyond the single folder share)
This is achievable with ssh over qrexec. I use this on my Qubes server. Create a qrexec service in the target VM which starts sshd in inetd mode (sshd -i), and then use ssh '-oProxyCommand=qrexec-client-vm other-vm-name local.SSH'. It should be noted that from a security perspective this is equivalent to qubes.VMShell* and effectively 100% eliminates any meaningful trust boundary protecting the target VM from the source VM. It is perhaps even more dangerous than qubes.VMShell since by default ssh exposes a source domain pty to manipulation by the target domain, which qubes.VMShell avoids. If this is really what you need, then maybe give it a try.
However: This completely violates the Qubes security model. If you are in the situation where you really need to be sharing such giant data across VMs, then perhaps using a single VM with the tools of both installed makes much more sense. Unless someone can provide evidence that users really require such functionality and are currently doing something more dangerous than this, then I believe it would be a design mistake to make this functionality easily available.
This is achievable with ssh over qrexec. I use this on my Qubes server. Create a qrexec service in the target VM which starts sshd in inetd mode ( However: This completely violates the Qubes security model. If you are in the situation where you really need to be sharing such giant data across VMs, then perhaps using a single VM with the tools of both installed makes much more sense. Unless someone can provide evidence that users really require such functionality and are currently doing something more dangerous than this, then I believe it would be a design mistake to make this functionality easily available. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tonsimple
May 30, 2017
@jpouellet
It seems to me that this approach would possibly be more of a "risk" than having source VM "doing samba" to share a folder with "downloader" (with some basic firewall rules preventing direct internet access for the source VM)
So far, SSHFS seems by far the nicest of options.
tonsimple
commented
May 30, 2017
|
@jpouellet So far, SSHFS seems by far the nicest of options. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
May 30, 2017
Contributor
Right, but then why have multiple VMs in the first place? If doing so eliminates the trust boundary between the VMs, then you gain no security by having separate VMs, so why use separate VMs at all? Do you need to use multiple tools on the same large dataset which are only available on linux XOR windows or something?
I don't see the benefit to further decomposition in this case -- and I say that as someone with an absurd number of VMs myself.
|
Right, but then why have multiple VMs in the first place? If doing so eliminates the trust boundary between the VMs, then you gain no security by having separate VMs, so why use separate VMs at all? Do you need to use multiple tools on the same large dataset which are only available on linux XOR windows or something? I don't see the benefit to further decomposition in this case -- and I say that as someone with an absurd number of VMs myself. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tonsimple
May 30, 2017
@jpouellet
Well, I suppose samba/SSHFS maintains some security boundary (adjusted for issue of exploits in SMB (lol ;-) ) or (in case of sshfs) SSH.
An "ideal-hypothetical" shared folder solution would be some daemon that doesn't need to run as root and can be run as separate user (which should in theory limit the amount of mayhem if "something happens") but I'm not sure that's possible given current qrexec mechanisms.
tonsimple
commented
May 30, 2017
•
|
@jpouellet An "ideal-hypothetical" shared folder solution would be some daemon that doesn't need to run as root and can be run as separate user (which should in theory limit the amount of mayhem if "something happens") but I'm not sure that's possible given current qrexec mechanisms. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
May 30, 2017
Member
IIUC the problem is:
- You have huge file downloaded from the network
- You don't want the tools used to parse the file to communicate with the network
I think with the currently available features, solutions closes to those requirements is:
- Create fresh AppVM (ideally DispVM, but it isn't possible to adjust its size, at least right now)
- Start it with network connected
- Download the file
- Disable networking for this VM (set netvm to "none")
- Process the file.
- Do not ever connect this AppVM to the network again, if you want to process another file, use new AppVM.
|
IIUC the problem is:
I think with the currently available features, solutions closes to those requirements is:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Sounds like a similar use case to #2486 (comment). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
holiman
Jun 14, 2018
I also would like this feature, but for a different usecase. I use different VMs for development, e.g one for golang, another VM that builds docker images, and a third for npm/electron and javascript things. I would like to be able to have a shared disk area that I can use for git repositories, instead of having to qvm-copy entire repos between the different VMs, and also not have to set up gpg-split in each vm (I use gpg-split to sign git commits).
I'd want to do e.g electron-dev in a, build docker image in b and commit/sign/push in c.
holiman
commented
Jun 14, 2018
|
I also would like this feature, but for a different usecase. I use different VMs for development, e.g one for golang, another VM that builds docker images, and a third for npm/electron and javascript things. I would like to be able to have a shared disk area that I can use for git repositories, instead of having to I'd want to do e.g electron-dev in |
tonsimple commentedMay 21, 2017
Basically what it says on the can.
Right now, I'm using a separate VM with smb server to share folders between several VMs (including a windows one), but it
inspired by reading about https://github.com/QubesOS/qubes-app-linux-usb-proxy while trying to come up with a way to share a folder with a qube that is supposed to have direct connection to netvm (thus not connected to the proxyvm which the smb hosting one is connected to)