Skip to content
This repository was archived by the owner on Aug 15, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Vagrant.configure("2") do |config|

config.vm.box = VB_IMAGE

config.vm.network "public_network", ip: LAN_IP, netmask: "255.255.255.0", bridge: LAN_IF
if STANDALONE.downcase == "yes"
config.vm.network "public_network", ip: LAN_IP, netmask: "255.255.255.0", bridge: LAN_IF
else
config.vm.network "public_network", auto_config: true, bridge: LAN_IF
end

if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
Expand Down
31 changes: 12 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@

# Source setting.sh
source /vagrant/settings.sh

# Fetching LAN_IP and network address
if [[ ${STANDALONE,,} != yes ]]; then
LAN_IP=$(ip addr show enp0s8 | grep -Po 'inet \K[\d.]+')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to use interface for now.

fi
NETWORK="$(echo $LAN_IP | cut -d'.' -f1-3)"

# Updating packages
# Adding repository and Updating packages
add-apt-repository ppa:ts.sch.gr --yes
apt update --yes
# Setting type of user interface with a boot parameter - https://www.debian.org/releases/jessie/i386/ch05s03.html
DEBIAN_FRONTEND=noninteractive apt upgrade --yes

# Installing dependencies
apt install --yes --install-recommends dnsmasq ldm-ubuntu-theme ltsp-server
# Installing packages
apt install --yes --install-recommends ltsp-server epoptes
DEBIAN_FRONTEND=noninteractive apt install --yes --install-recommends ltsp-client
apt install --yes epoptes epoptes-client resolvconf
apt install --yes ltsp-manager

# Adding vagrant user to group epoptes
gpasswd -a ${SUDO_USER:-$USER} epoptes
gpasswd -a ${SUDO_USER:-$(logname)} epoptes

# Updating kernel
echo 'IPAPPEND=3' >> /etc/ltsp/update-kernels.conf
/usr/share/ltsp/update-kernels

# Configuring resolvconf
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolvconf/resolv.conf.d/head
mv /etc/resolv.conf /etc/resolv.conf.backup
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
resolvconf -u

# Configure dnsmasq
echo "port=5353" >> /etc/dnsmasq.conf
ltsp-config dnsmasq

# enabling password authentication
Expand All @@ -47,11 +45,6 @@ echo 'INIT_COMMAND_MV_NBD_CHECKUPDATE="mv /usr/share/ldm/rc.d/I01-nbd-checkupdat
# Installing additional software
apt install --yes $PACKAGES

# Installing ltsp-manager
add-apt-repository ppa:ts.sch.gr -y
apt update --yes
apt install --yes ltsp-manager

# Creating client image
ltsp-update-image --cleanup /

Expand All @@ -70,7 +63,7 @@ else
echo "There is an existing DHCP server running"
echo "LTSP server won't provide DHCP services.."
sed -i /etc/dnsmasq.d/ltsp-server-dnsmasq.conf \
-e "/192.168.111.0,proxy\$/ c dhcp-range=${NETWORK}.0,proxy"
-e "/192.168.1.0,proxy\$/ c dhcp-range=${NETWORK}.0,proxy"
fi

# Restarting service
Expand Down
2 changes: 1 addition & 1 deletion settings.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mode of operation. yes for standalone mode. no for normal mode
# refer this - https://github.com/docker-scripts/dev--LTSP/wiki/LTSP-Modes-of-Operation
STANDALONE="yes"
STANDALONE="no"

# IP address of ltsp server
LAN_IP="192.168.111.16"
Expand Down