mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-12-23 19:39:47 +00:00
Shared directory
This commit is contained in:
parent
82011c214c
commit
245b06592b
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ qemu/qcow2/*
|
||||
!qemu/qcow2/.keep
|
||||
qemu/bin/*
|
||||
!qemu/bin/.keep
|
||||
share/*
|
||||
!share/.keep
|
||||
|
@ -9,12 +9,10 @@ if ! test -e "$NIX_DISK_IMAGE"; then
|
||||
fi
|
||||
|
||||
# Create a directory for storing temporary data of the running VM.
|
||||
if [ -z "$TMPDIR" -o -z "$USE_TMPDIR" ]; then
|
||||
TMPDIR=$(mktemp -d nix-vm.XXXXXXXXXX --tmpdir)
|
||||
fi
|
||||
TMPDIR=$(dirname ${NIX_DISK_IMAGE})/../../share/NAME_PLACEHOLDER
|
||||
|
||||
# Create a directory for exchanging data with the VM.
|
||||
mkdir -p $TMPDIR/xchg
|
||||
mkdir -p $TMPDIR
|
||||
cd $TMPDIR
|
||||
|
||||
NIX_SYSTEM="NIX_SYSTEM_PLACEHOLDER"
|
||||
@ -29,8 +27,8 @@ qemu-system-x86_64 -enable-kvm \
|
||||
-spice port=PORT_PLACEHOLDER,addr=127.200.0.1,disable-ticketing,image-compression=off,seamless-migration=on \
|
||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
-virtfs local,path=/nix/store,security_model=none,mount_tag=store,readonly \
|
||||
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
|
||||
-virtfs local,path=${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
|
||||
-virtfs local,path=$TMPDIR,security_model=none,mount_tag=xchg \
|
||||
-virtfs local,path=${SHARED_DIR:-$TMPDIR},security_model=none,mount_tag=shared \
|
||||
-drive index=0,id=drive$((0 + 1)),file=$NIX_DISK_IMAGE,cache=writeback,werror=report,if=virtio \
|
||||
-kernel ${NIX_SYSTEM}/kernel \
|
||||
-initrd ${NIX_SYSTEM}/initrd \
|
||||
|
0
share/.keep
Normal file
0
share/.keep
Normal file
Loading…
Reference in New Issue
Block a user