Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Virtualbox inside Docker

I'm trying to get VirtualBox to run inside of Docker. I'm 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 virtualbox inside a container. When I run sudo docker start container_id, it echoes back the container_id but doesn't add it to the running containers. I check with sudo docker ps and it is not there; however, it is there with sudo docker ps -a.

What am I doing wrong? I get no errors either.

EDIT: I'm running Docker in Ubuntu 15.04 (Not inside VirtualBox)

like image 911
o.o Avatar asked May 24 '26 12:05

o.o


1 Answers

You have to let docker to connect to your local X server. There are different ways to do this. One straight way is running xhost +local:docker before running your container (i.e.: before docker run).

like image 130
Javier Cortejoso Avatar answered May 27 '26 08:05

Javier Cortejoso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!