diff options
author | Jonathan Bauer | 2021-05-04 13:38:35 +0200 |
---|---|---|
committer | Jonathan Bauer | 2021-05-04 13:38:35 +0200 |
commit | 0bfcb437864bf0f43d88cf10013237dbf0525a0d (patch) | |
tree | 74004836ad12c9eecb7b0d0a00faf5243dbadf2e /core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/mltk (diff) | |
download | mltk-0bfcb437864bf0f43d88cf10013237dbf0525a0d.tar.gz mltk-0bfcb437864bf0f43d88cf10013237dbf0525a0d.tar.xz mltk-0bfcb437864bf0f43d88cf10013237dbf0525a0d.zip |
[run-virt-docker] initial run-virt support for docker
Diffstat (limited to 'core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include')
-rwxr-xr-x | core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include b/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include new file mode 100755 index 00000000..55f89e01 --- /dev/null +++ b/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include @@ -0,0 +1,59 @@ +#!/bin/bash +############################################################################### +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2009..2018 bwLehrpool-Projektteam +# +# This program/file is free software distributed under the GPL version 2. +# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# If you have any feedback please consult https://bwlehrpool.de and +# send your feedback to bwlehrpool@hs-offenburg.de. +# +# General information about bwLehrpool can be found at https://bwlehrpool.de +# +# ----------------------------------------------------------------------------- +# run-virt.include +# - qemu/kvm plugin for vmchooser run-virt +################################################################################ + +# BASH_SOURCE[0] contains the file being sourced, namely this one +declare -rg DOCKER_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")" +declare -rg DOCKER_INCLUDE_DIR="${DOCKER_PLUGIN_DIR}/includes" + +# TODO make this part of the metadata coming from the server +# TBD: "firewall printer usb slxfloppy sound netshares" +declare -rg PLUGIN_FEATURES="" + +run_plugin() { + + # VMX == bwlp-container-info.tar.gz + writelog "+ unpacking container ressources" + tar -xzvf "$TMPCONFIG" --directory "$CONFDIR" + + # VARS + # location of scripts and config files which will be used in desktop + export USER_CONTAINER_CONTEXT="$HOME/.local/docker" + # config file which will be filed with vars in the follwing process + export USER_CONTAINER_CONFIG="$USER_CONTAINER_CONTEXT/.bwlp-user-conf" + # dictonary which maps a drive letter to a directory + declare -Ag NETSHARE_DIR + + # apply "allow_root" option to gvfsd-fuse, so docker can bind mount gvfs network shares + writelog "+ gio_allow_root_fix.inc" + $( safesource "${DOCKER_INCLUDE_DIR}/gio_allow_root_fix.inc" ) + + # mount netshares from CONFDIR/netshares + writelog "+ gio_mount_netshare.inc" + $( safesource "${DOCKER_INCLUDE_DIR}/gio_mount_netshare.inc" ) + + writelog "+ init user container context" + $( safesource "${DOCKER_INCLUDE_DIR}/init_user_context.inc" ) + + # init bind mount option for container + writelog "+ init_bind_mount.inc" + $( safesource "${DOCKER_INCLUDE_DIR}/init_bind_mount.inc" ) + + # HACK: using the modified version of the wrapper script + declare -rg VIRTCMD="startxfce4" +} |