Last active
August 29, 2019 09:03
-
-
Save n7st/6eade283680564cfa1f1b84129084a15 to your computer and use it in GitHub Desktop.
Virtual machine configuration for running CrystalM2 Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DEBIAN_FRONTEND=noninteractive | |
# Update all system packages | |
apt-get update && apt-get -y upgrade | |
# Install X Windows and a basic window manager | |
apt-get install -q -y \ | |
debconf \ # Bundles dpkg-reconfigure | |
xorg openbox obmenu \ # Openbox and friends | |
xauth x11-apps x11-xserver-utils \ # Xorg and friends | |
lightdm \ # Login manager | |
tightvncserver \ # VNC server for remote access to the desktop | |
git \ # For cloning the M2 server's code | |
zip unzip # Archive management | |
# Harden the system a little with fail2ban | |
apt-get install -q -y fail2ban sendmail-bin \ | |
sendmail # For sending e-mail notifications for failed connections | |
# Instantiate local settings for fail2ban | |
cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local | |
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local | |
# Install tools for building C# applications on Linux | |
apt-get install -q -y mono-xbuild \ # For building the server software | |
mono-devel \ # Required libraries | |
gawk # GNU awk | |
# Create the script for VNC startup (this will be run by users later) | |
echo ' | |
#!/bin/bash | |
xrdb $HOME/.Xresources | |
openbox &' > /opt/xstartup | |
chmod 777 /opt/xstartup | |
# Set up a swapfile | |
fallocate -l 1G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment