Run AnyVM images inside Docker to spin up throwaway VMs for different OS targets.
docker run --rm -it ghcr.io/anyvm-org/anyvm --os freebsdReplace --os freebsd with the OS you want to boot.
mkdir -p test
docker run --rm -it \
-v $(pwd)/test:/mnt/host \
ghcr.io/anyvm-org/anyvm --os freebsddocker run --rm -it \
-p 10022:10022 \
ghcr.io/anyvm-org/anyvm --os freebsdDefault VM SSH port is 10022.
docker run --rm -it \
-p 8080:8080 \
ghcr.io/anyvm-org/anyvm --os freebsd -p 8080:80The first -p publishes container port 8080 to the host; the second forwards container 8080 to VM port 80.
Use -- to separate AnyVM arguments from a command you want executed via your SSH handler. Args after -- are executed in the VM.
docker run --rm -it ghcr.io/anyvm-org/anyvm --os freebsd -- uname -a
mkdir -p test
echo "text in host" >test/host.txt
docker run --rm -it \
-v $(pwd)/test:/mnt/host \
ghcr.io/anyvm-org/anyvm --os freebsd -- ls /mnt/host
Map the host KVM device into the container with read-write access to allow hardware acceleration.
docker run --rm -it \
--device /dev/kvm:/dev/kvm:rw \
ghcr.io/anyvm-org/anyvm --os freebsdSee the anyvm project for available OS targets and options.