Skip to content

Commit

Permalink
Merge pull request #45 from sbates130272/dev/stephen/virtfs
Browse files Browse the repository at this point in the history
run-vm: Add the ability to share folders on the host.
  • Loading branch information
sbates130272 authored Nov 22, 2024
2 parents 17f4b5d + 36f46ed commit 9e4e07e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qemu/run-vm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#
# (C) Stephen Bates <sbates@raithlin>
#
# A simple script to run a VM that was (probably) generated using the
# gen-vm script. Note that to pass in a host filesystem you need to
# run something like:
#
# sudo mount -t 9p -o trans=virtio hostfs /home/batesste/Projects -oversion=9p2000.L
#
# In the guest. For some reason -t virtfs does not work when running
# qemu directly but it does work when running via libvirt. Go figure!

VM_NAME=${VM_NAME:-qemu-minimal}
ARCH=${ARCH:-amd64}
Expand All @@ -23,10 +31,9 @@ fi
if [ ${FILESYSTEM} == "none" ]; then
FILESYSTEM_ARGS=""
else
FILESYSTEM_ARGS="-virtfs local,id=hostfs,path=${FILESYSTEM},security_model=mapped,mount_tag=hostfs"
FILESYSTEM_ARGS="-object memory-backend-memfd,id=mem,size=2G -virtfs local,path=${FILESYSTEM},security_model=passthrough,mount_tag=hostfs "
fi


if [ ${ARCH} == "amd64" ]; then
QARCH="x86_64"
QARCH_ARGS="-machine q35${KVM}"
Expand Down

0 comments on commit 9e4e07e

Please sign in to comment.