Shared directory

This commit is contained in:
Mikhail Klementev 2018-06-30 20:42:11 +00:00
parent 82011c214c
commit 245b06592b
3 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View file

@ -4,3 +4,5 @@ qemu/qcow2/*
!qemu/qcow2/.keep
qemu/bin/*
!qemu/bin/.keep
share/*
!share/.keep

View file

@ -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
View file