File Sharing From The Host & Remote Host SSH Connections For Linux Lite 4.x In Gnome Boxes
Gnome-boxes is a slick and easy to use little virtualization application. Coupled with SSH it can be quite useful for experimenting and customizing various Linux distributions in a virtual environment. I want to briefly explain and illustrate here how files can be shared remotely with SSH in a way that allows for hands on collaboration with others on such projects. I am not going to go through setting up SSH connections thoroughly here as I have covered that subject in other discussions. What I am going to discuss is running a Linux Lite 4.x system in gnome-boxes and setting up file sharing from the host and to and from remote servers and clients using SSH. It is remarkably easy to accomplish and works very well. My collaborator and I use it regularly exactly how this discussion explains by the end, though I will discuss a few alternatives. As always my interest here is in providing information that allows users to discover the simplest ways to do things that involve SSH. By now it should be pretty apparent to those who browse this web resource that SSH is one of my favorite Nix tools, Linux Lite is my favorite beginner Linux distribution, and Debian stable remains my favorite workhorse daily system. If this is your first time using SSH, or setting up shared connections, or using gnome-boxes, please check out the links below for all the information you’ll need to get ready for this discussion.
Linux Lite 4.x Connections To & From Debian 9
View Your Web Page Over The Internet With SFTP & GVFS
SSH To A Gnome-Boxes Virtual OS On Your Web Server
Linux Lite 4.x SSH X11 Forwarding Of Gnome-Boxes
Go ahead and install or start the Linux Lite 4.x system you have installed in gnome-boxes. Make sure it is recently updated. Mine is on Debian 9 but gnome-boxes runs fine in Debian 10 with Xorg, Ubuntu 18.04, and in many other Debian, Ubuntu, and RHEL based distributions. Once your Linux Lite 4.x system is updated and running open up its synaptic package manager (not your host’s) and locate and install the extra spice packages shown in the image below commonly called “guest tools”.
These packages will allow your Linux Lite 4.x DE to fill the gnome-boxes screen without the letterbox effect (black bars on each side) automatically, though with Linux Lite 4.x you will have to log in and log out and log back in again for it to take effect each time you use the system because of the lightdm login manager. These packages will also allow you to drag and drop files from your gnome-boxes host (Debian 9 in my case) to your gnome-boxes Linux Lite 4.x guest’s desktop. This is convenient for immediate local file transfer but no help to your remote collaborators if you intend to have any. See images below:
What I want to discuss here is how to enable a smooth secure way to collaborate with a remote collaborator who has hands on access to the same virtual system, specifically in this case a Linux Lite 4.x gnome-boxes guest, and share files with SSH between the guest, host, and remote user. If you want such a convenience you will have to install SSH client, server, and SFTP server to your Linux Lite 4.x system running in gnome-boxes. In your Linux Lite system open up synaptic package manager again and locate the packages you need. Some will already be installed by default and the others should install when you select the openssh server package. The image below shows the complete list of packages that should be installed on your Linux Lite system for all of this to work well.
Before I go on to Section 2 of this discussion it is worth commenting again that what I am about here is discussing and illustrating power networking in the simplest most reliable and secure way. I am not saying that there are not other more technical ways of accomplishing this goal, but I am concerned with users who are less technically inclined. It is possible for example to use a bridge connection and SSH between a gnome-boxes host and a gnome-boxes guest, and to use an SSH jump or proxy from the CLI as well. If you are more technically inclined and interested in such a connection see the link below, but in fact it is just as secure and far easier to follow this discussion to set up your gnome-boxes guest for collaboration this way. By default gnome-boxes guests cannot SSH with the gnome-boxes host except with a bridge, but with a remote user, such a file exchange with SSH is easy to accomplish.
How to use the qemu bridge helper in Debian 10
Is is also worth remarking that with a nested Xserver like Xming this collaboration connection and SSH file sharing is possible with a Windows 10 remote user in exactly the same way. Gnome-boxes just needs to be installed on a Linux host like Debian, Ubuntu, or Fedora WS.