Virtual box inside Docker

I am trying to run VirtualBox inside Docker. I am using this: https://registry.hub.docker.com/u/jess/virtualbox/dockerfile/ .

When I run the command:

sudo docker run -d \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=unix$DISPLAY \
    --privileged \
    --name virtualbox \
    jess/virtualbox

      

It adds a virtualbox inside the container. When I run sudo docker start container_id

it sends back the container_id but doesn't add it to the running containers. I check sudo docker ps

and it's not there; however he is there with sudo docker ps -a

.

What am I doing wrong? I don't get any errors either.

EDIT: I am running Docker on Ubuntu 15.04 (not inside VirtualBox)

+3


source to share


1 answer


You have to let docker connect to your local X server. There are different ways to do this. One direct path runs xhost +local:docker

before your container starts (ie: before docker run

).



+2


source







All Articles