My google queries are getting weird because of the architecture: I am running linux as host and an arch VM as guest. The arch VM does not have a GUI at all, simply the terminal. I mainly access the VM via SSH. The docker containers are currently located on the host system.

I want to run the docker container on the VM. How do I deploy them to the guest system? Is there a golden way to do it?


You essentially have 2 hosts:
1. The host you have Docker on;
2. and the Arch VM on which you do not have Docker.

It does not matter that one is a host for a VM and that the other one is a VM guest. They are 2 different systems.

Now, to answer your question:

To move the Docker containers to another host, you need to turn off those containers first, you cannot move them while they are online.

Then, you use docker commit to commit and save changes to the container's image. Afterwards, you can just copy the container image over to your VM (via scp or any other such means). When you have the container images in your VM, you can just use docker run to start them. It's as simple as that.

However, note that you do need to install docker on your VM in order to do that. As I mentioned, they're two different systems. Virtual machine or not - they do not share anything besides hardware resources.

  • 1
    Awesome, that was the hint I was looking for! Thank you so much! – elp Nov 30 '18 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.