diff --git a/init-shim.sh b/init-shim.sh index 5b7c972..7f39801 100755 --- a/init-shim.sh +++ b/init-shim.sh @@ -1,2 +1,2 @@ #!/bin/sh -unshare -rnm ./init.sh +unshare -rnmpf --mount-proc ./init.sh diff --git a/machines/loc1xe/setup.sh b/machines/loc1xe/setup.sh index 6e79802..fe1359e 100755 --- a/machines/loc1xe/setup.sh +++ b/machines/loc1xe/setup.sh @@ -29,5 +29,7 @@ nsenter --net="$vm_netns" ip route add 2a01:4f8:c0c:36b8:ff01:8000:0:0001/128 de nsenter --net="$vm_netns" ip route add default via 2a01:4f8:c0c:36b8:ff01:8000:0:0001 dev wg-vms nsenter --net="$vm_netns" sysctl net.ipv6.conf.all.forwarding=1 +tmux -N new-window -d -n vm1 socat stdio unix-listen:state/$mach/vm1.sock nsenter --net="$vm_netns" ./machines/$mach/vm1/start.sh -#nsenter --net="$vm_netns" ip route add 2a01:4f8:c0c:36b8:ff01:8000:0:0001/128 dev wg-vms onlink +nsenter --net="$vm_netns" ip link set dev tap-vm1 up +nsenter --net="$vm_netns" ip route add 2a01:4f8:c0c:36b8:ff01:8000:0:0003/128 dev tap-vm1 onlink diff --git a/machines/loc1xe/vm1/run.sh b/machines/loc1xe/vm1/run.sh index 7eab8c7..747efe5 100755 --- a/machines/loc1xe/vm1/run.sh +++ b/machines/loc1xe/vm1/run.sh @@ -5,5 +5,6 @@ set -eu arch=x86_64 kernel=/boot/vmlinuz-linux initrd_dir="$1" -shift 1 -exec qemu-system-"$arch" -m 1G -kernel "$kernel" -initrd "$initrd_dir/initrd.img" -nographic -append console=ttyS0,115200n1 "$@" +sockpath="$2" +shift 2 +qemu-system-"$arch" -m 1G -nic tap,id=net0,ifname=tap-vm1,script=no,downscript=no -kernel "$kernel" -initrd "$initrd_dir/initrd.img" -chardev socket,id=sock0,path="$sockpath",mux=on,server=off -serial chardev:sock0 -mon chardev=sock0,mode=readline -daemonize -append console=ttyS0,115200n1 "$@" diff --git a/machines/loc1xe/vm1/start.sh b/machines/loc1xe/vm1/start.sh index 80e33b8..53c8574 100755 --- a/machines/loc1xe/vm1/start.sh +++ b/machines/loc1xe/vm1/start.sh @@ -5,4 +5,5 @@ set -eu mkdir state/$mach/initdir -tmux new-window -d -n vm1 sh -c "machines/$mach/vm1/create.sh state/$mach/initdir && machines/$mach/vm1/run.sh state/$mach/initdir" +machines/$mach/vm1/create.sh state/$mach/initdir +machines/$mach/vm1/run.sh state/$mach/initdir state/$mach/vm1.sock