summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
authorroot2013-06-03 17:34:24 +0200
committerroot2013-06-03 17:34:24 +0200
commit79938062f218767d03b713db88cdca41543f5924 (patch)
tree89d5e2f288d7736401b34f8ccd57c6acb6d4257e /remote/modules
parent[kernel] Fix aufs3 patching (diff)
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-79938062f218767d03b713db88cdca41543f5924.tar.gz
tm-scripts-79938062f218767d03b713db88cdca41543f5924.tar.xz
tm-scripts-79938062f218767d03b713db88cdca41543f5924.zip
Merge branch 'master' of simonslx:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules2
-rw-r--r--remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf25
-rwxr-xr-xremote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env115
l---------remote/modules/vmchooser/data/etc/systemd/system/graphical.target.wants/vmchooser.service1
-rw-r--r--remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service9
-rw-r--r--remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include43
-rwxr-xr-xremote/modules/vmplayer/data/etc/openslx/vmware/vmware-env226
-rw-r--r--remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf12
-rw-r--r--remote/modules/vmplayer/data/etc/systemd/system/vmware.service8
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/bootstrap11
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/config19
l---------remote/modules/vmplayer/data/etc/vmware/icu1
l---------remote/modules/vmplayer/data/etc/vmware/installer.sh1
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/networking12
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/usbarb.rules4
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.conf40
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.leases7
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.conf43
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.leases7
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet8/nat.mac1
-rw-r--r--remote/modules/vmplayer/data/etc/vmware/vmnet8/nat/nat.conf60
-rw-r--r--remote/modules/vmplayer/vmplayer.build8
22 files changed, 365 insertions, 290 deletions
diff --git a/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules b/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules
index 387a5754..d18123fd 100644
--- a/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules
+++ b/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules
@@ -31,7 +31,7 @@ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_T
#
# http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=libudev/libudev-enumerate.c;h=da831449dcaf5e936a14409e8e68ab12d30a98e2;hb=HEAD#l742
-SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service"
+SUBSYSTEM=="net", KERNEL!="lo|vmnet*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service"
SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/%k"
SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target"
diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf b/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf
new file mode 100644
index 00000000..ec757ce4
--- /dev/null
+++ b/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf
@@ -0,0 +1,25 @@
+# basic samba configuration file for OpenSLX host-internal networking
+[global]
+ workgroup = OPENSLX
+ netbios name = HOMESERVER
+ security = SHARE
+ server string = Home and Print Provider
+ bind interfaces only = Yes
+ interfaces = NWIF
+ pid directory = PIDDIR
+
+[userhome]
+ comment = Home Directory of USER
+ path = /home/USER
+ create mask = 0700
+ guest ok = No
+ read only = No
+
+[scratch]
+ comment = Host System Temp Folder
+ path = /tmp
+ create mask = 0700
+ guest ok = Yes
+ read only = No
+ browseable = Yes
+
diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env b/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env
new file mode 100755
index 00000000..c4d99d6d
--- /dev/null
+++ b/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env
@@ -0,0 +1,115 @@
+#!/bin/sh
+
+export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
+
+#source config file with vars (e.g. ipaddr, macaddr, hostname)
+. /opt/openslx/config
+
+#from plugins/vmchooser/40-started-hw-config/run-virt.sh
+#TODO: extra systemd-service for hwinfo
+hwinfo --cdrom | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.cdrom
+hwinfo --floppy | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.floppy
+
+#from plugins/vmchooser/XX_vmchooser.sh
+VMCHOOSER_CONF_DIR=/etc/openslx/vmchooser
+
+mkdir -p ${VMCHOOSER_CONF_DIR}/loopimg
+mkdir -p ${VMCHOOSER_CONF_DIR}/fd-loop -m 1777
+
+# setup all generic virtualization / starting stuff like the floppy image
+# loop file for exchanging information between linux and vm guest
+if modprobe loop; then
+ mdev -s
+else
+ : #|| error "" nonfatal
+fi
+
+# mount a clean tempfs (bug in UnionFS prevents loopmount to work)
+grep -qE "unionfs |aufs " /proc/mounts && \
+mount -n -o size=1500k -t tmpfs vm-loopimg ${VMCHOOSER_CONF_DIR}/loopimg
+
+# create an empty floppy image of 1.4MByte size
+dd if=/dev/zero of=${VMCHOOSER_CONF_DIR}/loopimg/fd.img count=2880 bs=512 2>/dev/null
+chmod 0777 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img
+
+# use dos formatter copied into stage3
+mkdosfs ${VMCHOOSER_CONF_DIR}/loopimg/fd.img >/dev/null 2>&1 #|| error
+mount -n -t msdos -o loop,umask=000 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img \
+ ${VMCHOOSER_CONF_DIR}/fd-loop
+
+#pvs integration
+#if [ $vmchooser_pvs -ne 0 ]; then
+# sed -i /usr/share/xsessions/default.desktop \
+# -e "s,vmchooser$,vmchooser --pvs,"
+#fi
+
+# setup more scratch space for virtual machines, if configured
+mkdir -p /tmp/virt
+mkdir -p /var/log/samba
+
+# enable normal users to setup the extended virtual machine redo file space
+# and image source via network block device (NBD only at the moment)
+# allow to start/stop samba on virtual devices (latter one ignores multiple
+# independent daemons)
+
+#cat >> /mnt/etc/sudoers << EOF
+# allow to start and stop the special /tmp redo file space (RAM + NBD/NFS server RAID)
+#ALL ALL=NOPASSWD: /sbin/losetup /dev/loop*
+#ALL ALL=NOPASSWD: /sbin/mdadm -C /dev/md0 -l linear --raid-devices=2 /dev/loop* /dev/*
+#ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/sbin/nbd-client * * /dev/nbd*
+# allow to configure and start/stop samba services
+#ALL ALL=NOPASSWD: /opt/openslx/rootfs/bin/sed -i /etc/*/smb.conf -e *
+#ALL ALL=NOPASSWD: /usr/sbin/nmbd -s /etc/*/smb.conf
+#ALL ALL=NOPASSWD: /usr/sbin/smbd -s /etc/*/smb.conf
+#ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/bin/killall nmbd smbd
+#EOF
+
+#from plugins/vmchooser/80-after-plugins/virtualization.sh
+
+# change free mem
+totalmem=$(expr $(grep -i "memtotal" /proc/meminfo \
+ | awk '{print $2}') / 1024)
+echo "totalmem=${totalmem}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+
+# cpu cores
+CPU_CORES=$(grep 'processor.*:' /proc/cpuinfo | wc -l)
+if [ "${CPU_CORES}" -gt "1" 2>/dev/null ]; then
+ echo "cpu_cores=${CPU_CORES}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+else
+ echo 'cpu_cores=1' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+fi
+
+# arch
+echo "host_arch=$(uname -m)" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+
+# VT enabled cpu?
+if grep -q ^flags.*\\\<vmx\\\> /proc/cpuinfo; then
+ echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ echo 'kvm_module="kvm_intel"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ elif grep -q ^flags.*\\\<svm\\\> /proc/cpuinfo; then
+ echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ echo 'kvm_module="kvm_amd"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ else
+ echo "vtflag=0" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+fi
+
+# write mac
+echo "hostmacaddr=${SLX_PXE_MAC}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+# ip addr
+echo "hostip=${SLX_PXE_CLIENT_IP}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+# hostname
+echo "hostname=${SLX_HOSTNAME}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+
+# get further hw information
+j=0
+for i in $(cat /etc/openslx/hwinfo.cdrom); do
+ echo "cdrom_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ j=$(expr $j + 1)
+done
+
+j=0
+for i in $(cat /etc/openslx/hwinfo.floppy); do
+ echo "floppy_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf
+ j=$(expr $j + 1)
+done
+
diff --git a/remote/modules/vmchooser/data/etc/systemd/system/graphical.target.wants/vmchooser.service b/remote/modules/vmchooser/data/etc/systemd/system/graphical.target.wants/vmchooser.service
new file mode 120000
index 00000000..ad1590e8
--- /dev/null
+++ b/remote/modules/vmchooser/data/etc/systemd/system/graphical.target.wants/vmchooser.service
@@ -0,0 +1 @@
+../vmchooser.service \ No newline at end of file
diff --git a/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service b/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service
new file mode 100644
index 00000000..001d90f3
--- /dev/null
+++ b/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Sets up the vmchooser environment
+Wants=graphical.target
+Before=graphical.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/etc/openslx/vmchooser/vmchooser-env
diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include
index 012ad82a..837513d2 100644
--- a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include
+++ b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include
@@ -158,15 +158,13 @@ floppy0.startConnected = \"FALSE\"
floppy0.autodetect = \"TRUE\"
floppy0.fileName = \"auto detect\"
# we need floppy b: for our windows client configuration
-#TODO: enable floppy1
floppy1.present = \"${floppy1}\"
-floppy1.startConnected = \"FALSE\"
+floppy1.startConnected = \"TRUE\"
floppy1.fileType = \"file\"
floppy1.fileName = \"${floppy1name}\"
# nics
-#TODO: enable eth0
-ethernet0.present = \"FALSE\"
+ethernet0.present = \"TRUE\"
ethernet0.addressType = \"static\"
${network_virtualDev}
ethernet0.connectionType = \"${network_kind}\"
@@ -386,43 +384,6 @@ case "$parallel" in
;;
esac
-# adjust memory available for vmware guests
-#if [ -n "${forcemem}" ]; then
-# mem="${forcemem}"
-#else
-# case "$vmversion" in
-# 2.*|6.*)
-# permem=30
-# ;;
-# 3.*|7.*)
-# permem=25
-# ;;
-# esac
-# if [ "${totalmem}" -ge "2500" ]; then
-# permem=40
-# fi
-# # check if /tmp is on harddisk
-# if grep -qe "/dev/.* /tmp " /proc/mounts ; then
-# permem=60
-# id44="1"
-# # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
-# # (40% vmware | 40% confdir(vmem...) | 20% host
-# # VMplayer 2+ issue
-# if [ "${totalmem}" -ge "2500" ]; then
-# permem=40
-# confdir=/dev/shm/vmware/$USER
-# conffile=${confdir}/run-vmware.conf
-# mkdir -p /dev/shm/vmware/$USER
-# fi
-# fi
-# mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
-# if [ "${id44}" = "1" ]; then
-# hostmem=$(expr ${totalmem} - ${mem})
-# else
-# hostmem=$(expr ${totalmem} - ${mem} - ${mem})
-# fi
-#fi
-
# check if ide/scsi and hwver of image
# read only the first 30 lines to be shure
imghead=$(head -n 30 ${diskfile})
diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
index b829e9b6..6200c981 100755
--- a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
+++ b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
@@ -9,35 +9,202 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# §filename§
-# - §desc§
-# §generated§
-# -----------------------------------------------------------------------------
export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
+VMWARE_CONF_DIR=/etc/openslx/vmware
+
+#source config file
+. /opt/openslx/config
+. ${VMWARE_CONF_DIR}/vmware.conf
+
+setup_bridge() {
+ # Init hook to create a bridge on the active network interface
+ # (should be kept identical to the files of virtualbox and qemukvm plugins)
+ #############################################################################
+
+ local bridge=br0
+ local brnwif=eth0
+ local nwifmac=${SLX_PXE_MAC}
+
+ # bridge 0 already defined or some other problem
+ brctl addbr ${bridge}
+ brctl stp ${bridge} 0
+ brctl setfd ${bridge} 0.000000000001
+ ip link set addr ${nwifmac} ${bridge}
+ ip link set dev ${nwif} up
+ brctl addif ${bridge} ${nwif}
+}
+
+vm_dhcpd() {
+
+ #from plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh
+
+ # read the DNS configuration and if available set WPAD configuration
+ [ -z "${SLX_DNS}" ] && SLX_DNS="8.8.8.8"
+ [ -n "${wpad}" ] && wpad_config="option wpad ${wpad}"
+
+ # configuring dhcpd stub for virtual networks
+ cat > ${VMWARE_CONF_DIR}/udhcpd.conf << EOF
+# general udhcpd configuration file for virtual machines written by $0
+
+# start and end of the IP lease block
+start CNETWORK.20
+end CNETWORK.100
+
+# interface that udhcpd will use
+interface NWIF
+
+# how long an offered address is reserved (leased) in seconds
+offer_time 6000
+
+# location of the leases file
+lease_file LEASEFILE
+
+# location of the pid file
+pidfile PIDFILE
+
+option dns ${SLX_DNS}
+option subnet 255.255.255.0
+option router CNETWORK.1
+option wins CNETWORK.10
+option domain virtual.site ${domain_name}
+${wpad_config}
+
+# additional options known to udhcpd
+#subnet #timezone
+#router #timesvr
+#namesvr #dns
+#logsvr #cookiesvr
+#lprsvr #bootsize
+#domain #swapsvr
+#rootpath #ipttl
+#mtu #broadcast
+#wins #lease
+#ntpsrv #tftp
+#bootfile #wpad
+EOF
+
+}
+
+setup_network() {
+ #from plugins/vmware/XX_vmware.sh
+
+ mkdir -p /tmp/virt/vmware -m 1777
+ mkdir -p /dev/shm/vmware -m 1777
+ mkdir -p /var/run/vmware -m 1777
+ mkdir -p /etc/vmware/udhcpd
+
+ # variable might contain ",NAT" which is to be taken off
+ if [ -n "$vmnet1" ] ; then
+ local vmip=${vmnet1%/*} # x.x.x.x/yy => 'x.x.x.x'">
+ local vmsub=$(echo $vmip |sed 's,\(.*\)\..*,\1,') # x.x.x.x => x.x.x
+ # setting up the udhcpd configuration
+ sed -e "s,NWIF,vmnet1,;s,/misc/,/vmware/," \
+ -e "s,CNETWORK,$vmsub,;s,PIDFILE,/var/run/vmware/udhcpd-vmnet1.pid," \
+ -e "s,LEASEFILE,/var/run/vmware/udhcpd-vmnet1.leases," \
+ ${VMWARE_CONF_DIR}/udhcpd.conf >/etc/vmware/udhcpd/udhcpd-vmnet1.conf
+ # setting the base samba configuration if available
+ if [ -f /etc/openslx/vmchooser/smb.conf \
+ -a -f /usr/sbin/smbd ] ; then
+ sed -e "s#NWIF#vmnet1,vmnet8#;s,PIDDIR,/var/run/vmware," \
+ ${VMCHOOSER_CONF_DIR}/smb.conf \
+ >/etc/vmware/smb.conf
+ fi
+ fi
+
+ # vmware nat interface configuration
+ if [ -n "$vmnet8" ] ; then
+ local vmnet8ip=${vmnet8%/*}
+ local vmpx=${vmnet8#*/}
+ local vmsub=$(echo $vmnet8ip |sed 's,\(.*\)\..*,\1,') # x.x.x.x => x.x.x">
+ # vmip is user for vmnet8 device
+ # vmnet is user for config files nat.conf/dhcp
+ local vmip="${vmsub}.1"
+ local vmnet="${vmsub}.2"
+ # setting up the udhcpd configuration
+ sed -e "s,NWIF,vmnet8,;s,/misc/,/vmware/," \
+ -e "s,CNETWORK,$vmsub,;s,PIDFILE,/var/run/vmware/udhcpd-vmnet8.pid," \
+ -e "s,LEASEFILE,/var/run/vmware/udhcpd-vmnet8.leases," \
+ ${VMWARE_CONF_DIR}/udhcpd.conf >/etc/vmware/udhcpd/udhcpd-vmnet8.conf
+ # might be not needed any more ...
+ echo -e "# Linux NAT configuration file" \
+ > /etc/vmware/nat.conf
+ echo -e "[host]" \
+ >> /etc/vmware/nat.conf
+ echo -e "ip = $vmnet/$vmpx" \
+ >> /etc/vmware/nat.conf
+ echo -e "device = /dev/vmnet8" \
+ >> /etc/vmware/nat.conf
+ echo -e "activeFTP = 1" \
+ >> /etc/vmware/nat.conf
+ echo -e "[udp]" \
+ >> /etc/vmware/nat.conf
+ echo -e "timeout = 60" \
+ >> /etc/vmware/nat.conf
+ echo -e "[incomingtcp]" \
+ >> /etc/vmware/nat.conf
+ echo -e "[incomingudp]" \
+ >> /etc/vmware/nat.conf
+ echo "00:50:56:F1:30:50" > /etc/vmware/vmnet-natd-8.mac
+ fi
+
+ ############################################################################
+ # vmware stuff second part: setting up the environment
+ # make udhcpd more silent
+ touch /var/run/vmware/udhcpd-vmnet1.leases \
+ /var/run/vmware/udhcpd-vmnet8.leases
+
+ # create the needed devices which effects all vmware options
+ # they are not created automatically via module load
+ for i in "/dev/vmnet0 c 119 0" "/dev/vmnet1 c 119 1" \
+ "/dev/vmnet8 c 119 8" "/dev/vmmon c 10 165"; do
+ mknod $i
+ done
+
+ chmod 0700 /dev/vmnet*
+}
+
+adapt_tmpfs() {
+ # from plugins/vmware/init-hooks/80-after-plugins/adapt-tmpfs.sh
+ # Init hook to adapt the tmpfs size for VMware/Player
+ # (should be kept identical to the files of virtualbox plugin)
+ #############################################################################
+
+ # adapt tmpfs size (overbook)
+ case $(grep tmpfs /proc/mounts) in
+ */tmp*)
+ mount -o remount,size=175% /tmp
+ ;;
+ */uniontmp*)
+ mount -o remount,size=175% /uniontmp
+ ;;
+ esac
+}
+
+#from /etc/init.d/vmware-env
+
#functions: helper functions
tempdir () {
-# Create a special tempfs directory
-mkdir -m 1777 -p /tmp/vmware
-# Don't mount special tempfs, when using local harddrive for /tmp
-[ ! -n "$(cat /proc/mounts |grep ' /tmp '|grep '/dev/sd')" ] \
- && mount -t tmpfs -o size=180%,mode=1777 tmpfs /tmp/vmware
+ # Create a special tempfs directory
+ mkdir -m 1777 -p /tmp/vmware
+ # Don't mount special tempfs, when using local harddrive for /tmp
+ [ ! -n "$(cat /proc/mounts |grep ' /tmp '|grep '/dev/sd')" ] \
+ && mount -t tmpfs -o size=180%,mode=1777 tmpfs /tmp/vmware
}
load_modules () {
-# VMplayer common stuff
-insmod /lib/modules/vmware/vmmon.ko || return 1
-insmod /lib/modules/vmware/vmnet.ko || return 1
-# VMplayer 3.X specific stuff
-insmod /lib/modules/vmware/vmci.ko
-insmod /lib/modules/vmware/vmblock.ko
-insmod /lib/modules/vmware/vsock.ko
-
+ # VMplayer common stuff
+ insmod /lib/modules/vmware/vmmon.ko
+ insmod /lib/modules/vmware/vmnet.ko
+ # VMplayer 3.X specific stuff
+ insmod /lib/modules/vmware/vmci.ko
+ insmod /lib/modules/vmware/vmblock.ko
+ insmod /lib/modules/vmware/vsock.ko
}
unload_modules () {
-rmmod vmnet vmmonvsock vmci vmblock 2>/dev/null
+ rmmod vmnet vmmonvsock vmci vmblock
}
vmnetif () {
@@ -53,7 +220,7 @@ if [ -n "$vmnet1" ] ; then
ip addr add $vmnet1 dev vmnet1
ip link set vmnet1 up
if [ -n "$vmnet1nat" ] ; then
- echo "1" >/proc/sys/net/ipv4/conf/vmnet1/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet1/forwarding
echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
fi
/opt/openslx/usr/sbin/udhcpd \
@@ -64,13 +231,13 @@ if [ -n "$vmnet8" ] ; then
/dev/vmnet8 vmnet8
ip addr add $vmnet8 dev vmnet8
ip link set vmnet8 up
- echo "1" >/proc/sys/net/ipv4/conf/vmnet8/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet8/forwarding
echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
-# TODO: iptables in stage32?
-# iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
+ # TODO: iptables in stage32?
+ # iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
# /etc/vmware/vmnet-natd-8.mac simply contains a mac like 00:50:56:F1:30:50
$location/vmnet-natd -d /var/run/vmnet-natd-8.pid \
- -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf 2>/dev/null # or logfile
+ -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf # or logfile
/opt/openslx/usr/sbin/udhcpd \
-S /etc/vmware/udhcpd/udhcpd-vmnet8.conf
fi
@@ -80,28 +247,28 @@ fi
vmblock () {
# let point the path directly to the directory where the binary lives
/usr/bin/vmware-usbarbitrator
-
}
+
case "$1" in
start)
#start: defines start function for initscript
- # load the configuration file
- . /etc/openslx/vmware/vmware.conf
+ vm_dhcpd
+ setup_network
+# adapt_tmpfs
# hack to access the first serial/parallel port
chmod a+rw /dev/ttyS0
chmod a+rw /dev/parport0
tempdir
load_modules
vmnetif
- # vmblock
-
+ vmblock
;;
stop)
#stop: defines stop function for initscript
killall vmnet-netifup vmnet-natd vmnet-bridge vmware vmplayer \
- vmware-tray vmnet-dhcpd 2>/dev/null
+ vmware-tray vmnet-dhcpd
# might take a while until all services are shut down
sleep 1
umount -l /tmp/vmware 2>/dev/null
@@ -124,4 +291,3 @@ case "$1" in
;;
esac
-exit 0
diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
index 5a52ca41..210b814f 100644
--- a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
+++ b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
@@ -1,8 +1,8 @@
-# configuration file for vmware background services written in stage3 setup
-#vmnet0=true
-#vmnet1=192.168.101.1/24
-#vmnet1nat=true
-#vmnet8=192.168.102.1/24
-# stage1 variables produced during plugin install
+#configuration file for vmware background services written in stage3 setup
+vmnet0=true
+vmnet1=192.168.101.1/24
+vmnet1nat=true
+vmnet8=192.168.102.1/24
+#stage1 variables produced during plugin install
version="5.0"
buildversion="1031769"
diff --git a/remote/modules/vmplayer/data/etc/systemd/system/vmware.service b/remote/modules/vmplayer/data/etc/systemd/system/vmware.service
index df5331e0..cdb0b083 100644
--- a/remote/modules/vmplayer/data/etc/systemd/system/vmware.service
+++ b/remote/modules/vmplayer/data/etc/systemd/system/vmware.service
@@ -1,9 +1,9 @@
[Unit]
Description=Sets up the vmware environment
-Wants=graphical.target
-Before=graphical.target
+Requires=vmchooser.service
+After=vmchooser.service
[Service]
-Type=simple
+Type=oneshot
+RemainAfterExit=true
ExecStart=/etc/openslx/vmware/vmware-env start
-ExecStop=/etc/openslx/vmware/vmware-env stop
diff --git a/remote/modules/vmplayer/data/etc/vmware/bootstrap b/remote/modules/vmplayer/data/etc/vmware/bootstrap
deleted file mode 100644
index 9417c7fe..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/bootstrap
+++ /dev/null
@@ -1,11 +0,0 @@
-PREFIX="/usr"
-BINDIR="/usr/bin"
-SBINDIR="/usr/sbin"
-LIBDIR="/usr/lib"
-DATADIR="/usr/share"
-SYSCONFDIR="/etc"
-DOCDIR="/usr/share/doc"
-MANDIR="/usr/share/man"
-INCLUDEDIR="/usr/include"
-INITDIR="/etc/init.d"
-INITSCRIPTDIR="/etc/init.d"
diff --git a/remote/modules/vmplayer/data/etc/vmware/config b/remote/modules/vmplayer/data/etc/vmware/config
index 5a62a179..eb5d01c0 100644
--- a/remote/modules/vmplayer/data/etc/vmware/config
+++ b/remote/modules/vmplayer/data/etc/vmware/config
@@ -1,19 +1,4 @@
.encoding = "UTF-8"
-NETWORKING = "yes"
-VMBLOCK_CONFED = "no"
-gksu.rootMethod = "su"
+prefvmx.minVmMemPct = "100"
+prefvmx.useRecommendedLockedMemSize = "TRUE"
libdir = "/usr/lib/vmware"
-VMCI_CONFED = "no"
-VSOCK_CONFED = "no"
-initscriptdir = "/etc/init.d"
-authd.fullpath = "/usr/sbin/vmware-authd"
-bindir = "/usr/bin"
-installerDefaults.componentDownloadEnabled = "yes"
-installerDefaults.autoSoftwareUpdateEnabled.epoch = "4837526839"
-vix.config.version = "1"
-player.product.version = "5.0.2"
-installerDefaults.dataCollectionEnabled.epoch = "9979927113"
-installerDefaults.dataCollectionEnabled = "no"
-installerDefaults.transferVersion = "1"
-installerDefaults.autoSoftwareUpdateEnabled = "no"
-product.buildNumber = "1031769"
diff --git a/remote/modules/vmplayer/data/etc/vmware/icu b/remote/modules/vmplayer/data/etc/vmware/icu
deleted file mode 120000
index d1ebea7d..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/icu
+++ /dev/null
@@ -1 +0,0 @@
-/usr/lib/vmware/icu \ No newline at end of file
diff --git a/remote/modules/vmplayer/data/etc/vmware/installer.sh b/remote/modules/vmplayer/data/etc/vmware/installer.sh
deleted file mode 120000
index f178b8cc..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/installer.sh
+++ /dev/null
@@ -1 +0,0 @@
-/usr/lib/vmware-installer/2.1.0/vmware-uninstall-downgrade \ No newline at end of file
diff --git a/remote/modules/vmplayer/data/etc/vmware/networking b/remote/modules/vmplayer/data/etc/vmware/networking
deleted file mode 100644
index d2ea7361..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/networking
+++ /dev/null
@@ -1,12 +0,0 @@
-VERSION=1,0
-answer VNET_1_DHCP yes
-answer VNET_1_DHCP_CFG_HASH ABD785E9C7BA236946CF10ED6B15A580E522B13D
-answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
-answer VNET_1_HOSTONLY_SUBNET 172.16.110.0
-answer VNET_1_VIRTUAL_ADAPTER yes
-answer VNET_8_DHCP yes
-answer VNET_8_DHCP_CFG_HASH 5E30544D23705A65173565BC8D6C51008A0F9AF2
-answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
-answer VNET_8_HOSTONLY_SUBNET 192.168.167.0
-answer VNET_8_NAT yes
-answer VNET_8_VIRTUAL_ADAPTER yes
diff --git a/remote/modules/vmplayer/data/etc/vmware/usbarb.rules b/remote/modules/vmplayer/data/etc/vmware/usbarb.rules
deleted file mode 100644
index c3198bb4..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/usbarb.rules
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "version": 1,
- "rules": []
-} \ No newline at end of file
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.conf b/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.conf
deleted file mode 100644
index 6aeb3f1e..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet1.
-#
-# This file was automatically generated by the VMware configuration program.
-# See Instructions below if you want to modify it.
-#
-# We set domain-name-servers to make some DHCP clients happy
-# (dhclient as configured in SuSE, TurboLinux, etc.).
-# We also supply a domain name to make pump (Red Hat 6.x) happy.
-#
-
-
-###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" #####
-# Modification Instructions: This section of the configuration file contains
-# information generated by the configuration program. Do not modify this
-# section.
-# You are free to modify everything else. Also, this section must start
-# on a new line
-# This file will get backed up with a different name in the same directory
-# if this section is edited and you try to configure DHCP again.
-
-# Written at: 05/06/2013 17:43:41
-allow unknown-clients;
-default-lease-time 1800; # default is 30 minutes
-max-lease-time 7200; # default is 2 hours
-
-subnet 172.16.110.0 netmask 255.255.255.0 {
- range 172.16.110.128 172.16.110.254;
- option broadcast-address 172.16.110.255;
- option domain-name-servers 172.16.110.1;
- option domain-name localdomain;
- default-lease-time 1800; # default is 30 minutes
- max-lease-time 7200; # default is 2 hours
-}
-host vmnet1 {
- hardware ethernet 00:50:56:C0:00:01;
- fixed-address 172.16.110.1;
- option domain-name-servers 0.0.0.0;
- option domain-name "";
-}
-####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.leases b/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.leases
deleted file mode 100644
index 512c0de2..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet1/dhcpd/dhcpd.leases
+++ /dev/null
@@ -1,7 +0,0 @@
-# All times in this file are in UTC (GMT), not your local timezone. This is
-# not a bug, so please don't ask about it. There is no portable way to
-# store leases in the local timezone, so please don't request this as a
-# feature. If this is inconvenient or confusing to you, we sincerely
-# apologize. Seriously, though - don't ask.
-# The format of this file is documented in the dhcpd.leases(5) manual page.
-
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.conf b/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.conf
deleted file mode 100644
index 9f27b6f0..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.conf
+++ /dev/null
@@ -1,43 +0,0 @@
-# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet8.
-#
-# This file was automatically generated by the VMware configuration program.
-# See Instructions below if you want to modify it.
-#
-# We set domain-name-servers to make some DHCP clients happy
-# (dhclient as configured in SuSE, TurboLinux, etc.).
-# We also supply a domain name to make pump (Red Hat 6.x) happy.
-#
-
-
-###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" #####
-# Modification Instructions: This section of the configuration file contains
-# information generated by the configuration program. Do not modify this
-# section.
-# You are free to modify everything else. Also, this section must start
-# on a new line
-# This file will get backed up with a different name in the same directory
-# if this section is edited and you try to configure DHCP again.
-
-# Written at: 05/06/2013 17:43:41
-allow unknown-clients;
-default-lease-time 1800; # default is 30 minutes
-max-lease-time 7200; # default is 2 hours
-
-subnet 192.168.167.0 netmask 255.255.255.0 {
- range 192.168.167.128 192.168.167.254;
- option broadcast-address 192.168.167.255;
- option domain-name-servers 192.168.167.2;
- option domain-name localdomain;
- default-lease-time 1800; # default is 30 minutes
- max-lease-time 7200; # default is 2 hours
- option netbios-name-servers 192.168.167.2;
- option routers 192.168.167.2;
-}
-host vmnet8 {
- hardware ethernet 00:50:56:C0:00:08;
- fixed-address 192.168.167.1;
- option domain-name-servers 0.0.0.0;
- option domain-name "";
- option routers 0.0.0.0;
-}
-####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.leases b/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.leases
deleted file mode 100644
index 512c0de2..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet8/dhcpd/dhcpd.leases
+++ /dev/null
@@ -1,7 +0,0 @@
-# All times in this file are in UTC (GMT), not your local timezone. This is
-# not a bug, so please don't ask about it. There is no portable way to
-# store leases in the local timezone, so please don't request this as a
-# feature. If this is inconvenient or confusing to you, we sincerely
-# apologize. Seriously, though - don't ask.
-# The format of this file is documented in the dhcpd.leases(5) manual page.
-
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat.mac b/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat.mac
deleted file mode 100644
index 337d094a..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat.mac
+++ /dev/null
@@ -1 +0,0 @@
-00:50:56:E9:43:27
diff --git a/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat/nat.conf b/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat/nat.conf
deleted file mode 100644
index 791f9a7e..00000000
--- a/remote/modules/vmplayer/data/etc/vmware/vmnet8/nat/nat.conf
+++ /dev/null
@@ -1,60 +0,0 @@
-# VMware NAT configuration file
-
-[host]
-
-# NAT gateway address
-ip = 192.168.167.2
-netmask = 255.255.255.0
-
-# VMnet device if not specified on command line
-device = /dev/vmnet8
-
-# Allow PORT/EPRT FTP commands (they need incoming TCP stream ...)
-activeFTP = 1
-
-# Allows the source to have any OUI. Turn this on if you change the OUI
-# in the MAC address of your virtual machines.
-allowAnyOUI = 1
-
-# Controls if (TCP) connections should be reset when the adapter they are
-# bound to goes down
-resetConnectionOnLinkDown = 1
-
-# Controls if (TCP) connection should be reset when guest packet's destination
-# is NAT's IP address
-resetConnectionOnDestLocalHost = 1
-
-[tcp]
-
-# Value of timeout in TCP TIME_WAIT state, in seconds
-timeWaitTimeout = 30
-
-[udp]
-
-# Timeout in seconds. Dynamically-created UDP mappings will purged if
-# idle for this duration of time 0 = no timeout, default = 60; real
-# value might be up to 100% longer
-timeout = 60
-
-[netbios]
-# Timeout for NBNS queries.
-nbnsTimeout = 2
-
-# Number of retries for each NBNS query.
-nbnsRetries = 3
-
-# Timeout for NBDS queries.
-nbdsTimeout = 3
-
-[incomingtcp]
-
-# Use these with care - anyone can enter into your VM through these...
-# The format and example are as follows:
-#<external port number> = <VM's IP address>:<VM's port number>
-#8080 = 172.16.3.128:80
-
-[incomingudp]
-
-# UDP port forwarding example
-#6000 = 172.16.3.0:6001
-
diff --git a/remote/modules/vmplayer/vmplayer.build b/remote/modules/vmplayer/vmplayer.build
index e2c830c0..1c9887ef 100644
--- a/remote/modules/vmplayer/vmplayer.build
+++ b/remote/modules/vmplayer/vmplayer.build
@@ -1,10 +1,10 @@
fetch_source() {
#mount vmware bundle directory
- [ ! -d /mnt/store/vmware ] && mkdir -p /mnt/store/vmware
- if [ "x$(ls /mnt/store/vmware)" == "x" ]; then
- mount -t nfs -o ro,async,nolock 132.230.8.113:/srv/vmext /mnt/store/vmware || perror "Could not mount vmware bundle directory. Exiting."
+ [ ! -d /mnt/store ] && mkdir -p /mnt/store
+ if [ "x$(ls /mnt/store)" == "x" ]; then
+ mount -t nfs -o ro,async,nolock 132.230.8.113:/srv/vmext /mnt/store || perror "Could not mount vmware bundle directory. Exiting."
fi
- ARCH=$(uname -m)
+ ARCH="$(uname -m)"
[ "$ARCH" = "i686" ] && ARCH=i386
local BUNDLE="$(find /mnt/store/vmware -type f -name "VMware-Player*.${ARCH}.bundle" | head -1)"
[ -z "$BUNDLE" ] && perror "Could not find vmplayer at /mnt/store for ARCH = $ARCH"