diff options
Diffstat (limited to 'src/os-plugins/plugins/qemukvm')
-rw-r--r-- | src/os-plugins/plugins/qemukvm/XX_qemukvm.sh | 11 | ||||
-rw-r--r-- | src/os-plugins/plugins/qemukvm/files/run-virt.include | 21 |
2 files changed, 24 insertions, 8 deletions
diff --git a/src/os-plugins/plugins/qemukvm/XX_qemukvm.sh b/src/os-plugins/plugins/qemukvm/XX_qemukvm.sh index 3f952241..da3c998e 100644 --- a/src/os-plugins/plugins/qemukvm/XX_qemukvm.sh +++ b/src/os-plugins/plugins/qemukvm/XX_qemukvm.sh @@ -1,5 +1,5 @@ # Copyright (c) 2009..2010 - RZ Uni Freiburg -# Copyright (c) 2008..2010 - OpenSLX GmbH +# Copyright (c) 2008..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -107,6 +107,15 @@ ALL ALL=NOPASSWD: /sbin/sysctl -q -w net.ipv4.conf.*.forwarding=? ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/bin/killall -9 udhcpd ALL ALL=NOPASSWD: /sbin/iptables -t nat -? POSTROUTING -s 192.168.1*.0/24 -o br0 -j MASQUERADE EOF + + # setting the base samba configuration + if [ -f /mnt/opt/openslx/plugins/virtualization/smb.conf -a \ + -f /mnt/usr/sbin/smbd ] ; then + testmkd /mnt/etc/qemu + sed -e "s#NWIF#tapnat0#taphost0#;s#PIDDIR#/tmp/virt#" \ + /mnt/opt/openslx/plugins/virtualization/smb.conf \ + >/mnt/etc/qemu/smb.conf + fi fi else [ $DEBUGLEVEL -gt 0 ] && echo " * Configuration of 'qemukvm' plugin failed" diff --git a/src/os-plugins/plugins/qemukvm/files/run-virt.include b/src/os-plugins/plugins/qemukvm/files/run-virt.include index 64f2b3e1..80b9290d 100644 --- a/src/os-plugins/plugins/qemukvm/files/run-virt.include +++ b/src/os-plugins/plugins/qemukvm/files/run-virt.include @@ -1,7 +1,7 @@ # run-virt.include # ----------------------------------------------------------------------------- # Copyright (c) 2009..2010 - RZ Uni Freiburg -# Copyright (c) 2009..2010 - OpenSLX GmbH +# Copyright (c) 2009..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -220,15 +220,15 @@ cdrom1=${cdtest:-"FALSE"} ide="TRUE" hddrv="ide" -# TODO: nur bei vmchooser -#VIRTCMDOPTS="${VIRTCMDOPTS} -fda /dev/fd0" +# special feature for real and virtual floppy disks +[ ${floppy0} == TRUE ] && VIRTCMDOPTS="${VIRTCMDOPTS} -fda /dev/fd0" #VIRTCMDOPTS="${VIRTCMDOPTS} -fdb ${floppy1name}" # audio VIRTCMDOPTS="${VIRTCMDOPTS} -soundhw all" # serial -#VIRTCMDOPTS="${VIRTCMDOPTS} -serial /dev/ttyS0" +[ ${serial} == ttyS0 ] && VIRTCMDOPTS="${VIRTCMDOPTS} -serial /dev/ttyS0" writelog "Virtual Hardware:" writelog "\tGuest RAM:\t\t${mem} MB" @@ -247,7 +247,14 @@ writelog "\tNetwork kind:\t\t${network_kind}" ### finally set env for run-virt.sh ################################################################################ -# TODO: besser drive statt hda? +# configure and start samba service to provide user's home directory +if [ -f /usr/sbin/smbd ] ; then + sudo /opt/openslx/rootfs/bin/sed -i /etc/qemu/smb.conf -e "s,$USER,USER," + sudo /usr/sbin/nmbd -c /etc/qemu/smb.conf + sudo /usr/sbin/smbd -c /etc/qemu/smb.conf +fi + + #-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] # [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] # [,cache=writethrough|writeback|none][,format=f][,serial=s] @@ -301,7 +308,7 @@ if [ -c /dev/kvm -a "x${emu}" != "xqemu" ]; then [ -n "$VIRTCMD" ] && break done else - VIRTCMD=$(which qemu 2>/dev/null) + VIRTCMD=$(which qemu-system-i386 2>/dev/null) writelog "KVM available but /dev/kvm not found!" writelog "Trying fallback to QEMU emulation." fi @@ -310,7 +317,7 @@ if [ -z "${VIRTCMD}" ]; then writelog "No QEMU/KVM found, exiting!" rm -rf ${RMDIRS} exit 1 -elif [ "${VIRTCMD##*/}" = "qemu" ]; then +elif [ "${VIRTCMD##*/}" = "qemu-system-i386" ]; then writelog "User space emulation:\t\t${VIRTCMD}" else writelog "User space virtualization:\t${VIRTCMD}" |