Seitanas / kvm-vdi

linux-kvm based VDI solution
MIT License
217 stars 82 forks source link

[Feature Request] LTSP Session Screen Script for KVM-VDI #11

Closed jphein closed 8 years ago

jphein commented 8 years ago

Hello, I created a LTSP session screen script for SPICE. It works very well using the remote-viewer package. Here is a link:http://jphein.com/spice-session-screen-script-for-ltsp-thin-clients-running-under-ubuntu/

It would be awesome for those of us who use Ubuntu LTSP for client deployment to have it integrated with KVM-VDI.

jphein commented 8 years ago

This should do it:

cat vdi_init 
#!/bin/sh
#
# Screen script that launches KVM_VDI. Can be called from lts.conf
# like this:
#   SCREEN_07="vdi_init"
# or like this:
#   SCREEN_07="vdi_init"
#
# Copyright (c) 2016 Jeffrey Hein <http://jphein.com>
#
# This software is licensed under the GNU General Public License version 2,
# the full text of which can be found in the COPYING file.

. /usr/share/ltsp/screen-x-common
# segfaults if HOME is unset.
export HOME=${HOME:-/root}

# The same screen script can be used for other KVM_VDI viewers too, by just symlinking
# screen.d/{otherviewer} to screen.d/vdi_init.
basename=${0##*/}

if ! type $basename >/dev/null 2>&1; then
    echo "$basename couldn't be found."
    if [ "$basename" = "vdi_init" ]; then
        echo "Please make sure you have installed vdi_init into your client chroot."
    fi
    read nothing
    exit 1
fi

# Make XINITRC_DAEMON default to "True", to prevent X from restarting after
# logout. If you don't want that, force XINITRC_DAEMON=False in lts.conf.
export XINITRC_DAEMON="${XINITRC_DAEMON-True}"

COMMAND="$basename $*"

# The following logic is described at the top of xinitrc.
exec xinit /usr/share/ltsp/xinitrc "$COMMAND" -- "$DISPLAY" "vt${TTY}" -nolisten tcp $X_ARGS >/dev/null`
Seitanas commented 8 years ago

I'm not really familiar with LTSP clients. We are just using PXE/NFS booted thin clients with small Linux distribution. Where do you want me to add your script?

jphein commented 8 years ago

LTSP uses PXE/NBD. It builds the Ubuntu thinclient or fatclient for you. It also has a sweet configuration file lts.conf. Maybe I should submit these scripts to LTSP instead. I made one for VNC, SPICE, and KVM-VDI.

jphein commented 8 years ago

LTSP already includes these ones: kiosk ldm menu rdesktop shell ssh startx telnet xdmcp xfreerdp xterm

Seitanas commented 8 years ago

If you wish, I can include your script to my "thin_clients" folder

jphein commented 8 years ago

That would be awesome. I need to test it first. Still trying to get KVM-VDI to install in Ubuntu 16.04.