Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (72 sloc) 3.02 KB
#!/bin/bash
# SSH
sudo apt install ssh
# Ubiquity
sudo apt-get install ubiquity ubiquity-frontend-gtk
# ts.sch.gr repos
sudo add-apt-repository --yes ppa:ts.sch.gr #The Greek Schools repository
# LTSP
sudo apt install --yes --install-recommends ltsp-server-standalone ltsp-client epoptes
#KVM
sudo apt install virt-manager
sudo ltsp-config dnsmasq --enable-dns
sudo service dnsmasq restart
sudo gpasswd -a ${SUDO_USER:-$USER} epoptes
sudo apt purge --yes --auto-remove mate-hud snapd
sudo sh -c 'echo "deb http://pub.freerdp.com/repositories/deb/$(lsb_release -cs)/ freerdp-nightly main" >> /etc/apt/sources.list.d/freerdp-nightly.list'
wget -O - http://pub.freerdp.com/repositories/ADD6BF6D97CE5D8D.asc | sudo apt-key add -
sudo apt update
sudo apt install --yes freerdp-nightly
sudo ln -s /opt/freerdp-nightly/bin/xfreerdp /usr/bin/xfreerdp-nightly
cd /usr/share/ltsp/screen.d/
sudo ln -s xfreerdp xfreerdp-nightly
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/usr/share/ltsp/screen.d/rdpgui
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/usr/share/ltsp/screen.d/xfreerdp-prompt
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/usr/share/ltsp/screen.d/launch
sudo mkdir boxen
cd boxen
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/usr/share/ltsp/screen.d/boxen/welcome
cd ..
sudo ln -s launch welcome
sudo ln -s /sbin/shutdown shutdown
sudo chmod +x rdpgui xfreerdp-prompt launch boxen/welcome
#Disable Cloud init if using Azure image as your LTSP server
touch /etc/cloud/cloud-init.disabled
#Install pxe menu
cd /etc/ltsp
mv update-kernels.conf update-kernels.conf.bak
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/etc/ltsp/update-kernels.conf
sudo /usr/share/ltsp/update-kernels
sudo ltsp-update-image --cleanup /
sudo ltsp-update-kernels
cd /var/lib/tftpboot/ltsp/amd64/
sudo wget https://raw.githubusercontent.com/jphein/boxen/master/var/lib/tftpboot/amd64/lts.conf
##Install X2Go Server
sudo add-apt-repository --yes ppa:x2go/stable
sudo apt-get install --yes --install-recommends x2goserver x2gomatebindings
cd
ln -s /var/lib/tftpboot/ltsp/amd64/lts.conf lts.conf
echo "Configure your lts.conf with nano -w lts.conf"
echo "Done installing BoXen Brain!"
###dnsmasq hack for testing
sudo killall dnsmasq
sudo mv /etc/dnsmasq.d/libvirt-daemon /root/
sudo sh -c 'echo "dhcp-range=192.168.122.20,192.168.122.250,8h" >> /etc/dnsmasq.d/ltsp-server-dnsmasq.conf
sudo service dnsmasq restart
############################
#Create the PXE test KVM client
sudo virt-install \
--name pxe \
--memory 4096 \
--vcpus 2 \
--disk none \
--pxe \
--os-variant ubuntu17.10 \
--wait 0
echo "Connect to the PXE test client with: virt-viewer --connect qemu:///system pxe &"
# Virtual thin client:
#kvm -m 256 -vga vmware -ctrl-grab -no-shutdown -net nic,model=virtio -net user,tftp=/var/lib/tftpboot,bootfile=/ltsp/i386/pxelinux.0
##After cloning use this
#mv /var/lib/libvirt/images/pxe.qcow2 ~/Desktop/baby.qcow2
##Then Expose with NBD
#nbd-server 12345 /home/$USER/Desktop/baby.qcow2
You can’t perform that action at this time.