Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amd64/debian:bullseye
FROM amd64/debian:stable
LABEL com.iximiuz-project="docker-to-linux"
RUN apt-get -y update
RUN apt-get -y install extlinux fdisk
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ COL_GRN="\033[0;32m"
COL_END="\033[0m"

REPO=docker-to-linux
BRIDGE=`docker network inspect --format='{{json .Options}}' bridge | python -c 'import json,sys;obj=json.load(sys.stdin);print(obj["com.docker.network.bridge.name"])'`

.PHONY:
debian: debian.img
Expand Down Expand Up @@ -93,3 +94,10 @@ clean-docker-images:
echo "<noop>";\
fi

net:
ip tuntap add dev tap0 mod tap
ip link set dev tap0 master ${BRIDGE}
ip link set tap0 up

run-qemu-with-net:
qemu-system-x86_64 -drive file=linux.img,index=0,media=disk,format=raw -m 4096 -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,30 @@ Check out `Makefile` for more details or read my article on <a href="https://ixi

- Q: How can I access network from the VM / How can I SSH into the VM?

A: Networking is not configured at the moment. If you want to configure it yourself, search for TUN/TAP/bridge devices. Don't forget to open a PR if you come up with a working solution.
A: Networking is in early stages at the moment. If you want to configure it yourself, search for TUN/TAP/bridge devices.


## Network / basic connectivity

You'll need a virtual device (tun/tap) bridged with an interface such as ethernet or docker0.

Follow these steps if you already have docker0:

Create tap interface

tunctl -t tap0 -u `whoami`

Add tap0 to bridge

brctl addif docker0 tap0
ip link set ens3

Once you've done this you'll need to configure the interface inside the VM. Asumming your network interface is ens3.

ip addr add 172.17.0.10/16 dev ens3
ip link set ens3 up
ip route add default via 172.17.0.1

## Release notes
#### 2021-05-07
- Fix - Ubuntu 20.04 stopped working because of the changed path to vmlinuz and initrd files.
Expand Down
5 changes: 2 additions & 3 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM amd64/debian:bullseye
FROM amd64/debian:stable
LABEL com.iximiuz-project="docker-to-linux"
RUN apt-get -y update
RUN apt-get -y install --no-install-recommends \
linux-image-amd64 \
systemd-sysv
systemd-sysv iproute2 dnsutils vim isc-dhcp-client iputils-ping net-tools
RUN echo "root:root" | chpasswd