2015-04-28 19:30:19 +02:00
|
|
|
# Run virtualbox in a container
|
|
|
|
#
|
2015-06-09 07:26:07 +02:00
|
|
|
# docker run -d \
|
|
|
|
# -v /tmp/.X11-unix:/tmp/.X11-unix \
|
2015-06-05 20:55:25 +02:00
|
|
|
# -e DISPLAY=unix$DISPLAY \
|
2015-06-09 07:26:07 +02:00
|
|
|
# --privileged \
|
|
|
|
# --name virtualbox \
|
2015-06-05 20:55:25 +02:00
|
|
|
# jess/virtualbox
|
2015-04-28 19:30:19 +02:00
|
|
|
#
|
2015-06-09 07:26:07 +02:00
|
|
|
# On first run it will throw an error that you need to
|
|
|
|
# recompile the kernel module with: /etc/init.d/vboxdrv setup
|
|
|
|
#
|
|
|
|
# Here is how you get it to work:
|
|
|
|
# copy the files you need for the module from the container that
|
|
|
|
# is currently running to your host
|
|
|
|
#
|
2018-01-09 19:22:13 +01:00
|
|
|
# first the lib:
|
|
|
|
# docker cp virtualbox:/usr/lib/virtualbox /usr/lib
|
2015-06-09 07:26:07 +02:00
|
|
|
#
|
|
|
|
# then the share
|
2015-06-18 03:37:33 +02:00
|
|
|
# docker cp virtualbox:/usr/share/virtualbox /usr/share
|
2015-06-09 07:26:07 +02:00
|
|
|
#
|
|
|
|
# then run the script:
|
2018-01-09 19:22:13 +01:00
|
|
|
# /usr/lib/virtualbox/vboxdrv.sh setup
|
2015-06-09 07:26:07 +02:00
|
|
|
#
|
|
|
|
# it will recompile the module, you can then see it in lsmod
|
|
|
|
#
|
|
|
|
# then you can remove all the shit you copied
|
2018-01-09 19:22:13 +01:00
|
|
|
# rm -rf /usr/share/virtualbox /usr/lib/virtualbox
|
2015-06-09 07:26:07 +02:00
|
|
|
#
|
2016-10-01 05:12:42 +02:00
|
|
|
FROM debian:sid
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2015-04-28 19:30:19 +02:00
|
|
|
|
2017-02-12 19:38:40 +01:00
|
|
|
RUN buildDeps=' \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg \
|
|
|
|
' \
|
|
|
|
&& set -x \
|
|
|
|
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2016-08-12 04:15:28 +02:00
|
|
|
&& curl -sSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | apt-key add - \
|
|
|
|
&& echo "deb http://download.virtualbox.org/virtualbox/debian stretch contrib" >> /etc/apt/sources.list.d/virtualbox.list \
|
|
|
|
&& apt-get update && apt-get install -y \
|
2018-01-09 19:22:13 +01:00
|
|
|
virtualbox-5.2 \
|
2016-08-12 04:15:28 +02:00
|
|
|
--no-install-recommends \
|
2017-02-12 19:38:40 +01:00
|
|
|
&& apt-get purge -y --auto-remove $buildDeps
|
2015-04-28 19:30:19 +02:00
|
|
|
|
2015-06-05 19:24:11 +02:00
|
|
|
ENTRYPOINT [ "/usr/bin/virtualbox" ]
|