Last active
March 21, 2018 18:47
-
-
Save Zate/3045483a55fea157457ac5349f0055fe to your computer and use it in GitHub Desktop.
Setup stretch VM on ChromeOS and launch vscode
This file contains 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
#! /bin/bash | |
set -euf -o pipefail | |
curl -Lo /tmp/stretch.tgz http://github.com/lstoll/chromeoshack/releases/download/0.1/stretch.tgz | |
lxc image import /tmp/stretch.tgz --alias stretch | |
lxc launch stretch stretch | |
lxc exec stretch -- useradd -u 1000 -s "/bin/bash" -m "zate" | |
groups="audio cdrom dialout floppy plugdev sudo users video" | |
for group in ${groups}; do | |
lxc exec stretch -- usermod -aG "${group}" zate | |
done | |
lxc exec stretch -- loginctl enable-linger zate | |
lxc exec stretch -- sudo apt-get update \ | |
&& sudo apt-get install curl -y \ | |
&& curl -Lo /tmp/get_go.sh https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/1b80e9cb7b6bf136f296a3f63ab8108a0747bea2/get_go.sh \ | |
&& chmod +x /tmp/get_go.sh \ | |
&& cd /tmp \ | |
&& ./get_go.sh \ | |
&& curl -Lo /tmp/get_vscode.sh https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/bc749ff294782e66d4d5fb248aa2470bab119ad6/get_vscode.sh \ | |
&& chmod +x /tmp/get_vscode.sh \ | |
&& cd /tmp \ | |
&& ./get_vscode.sh | |
# Launch a session inside the container | |
lxc exec stretch -- /bin/login -f zate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment