Skip to content

Instantly share code, notes, and snippets.

@sjdonado
Last active April 16, 2021 11:43
Show Gist options
  • Save sjdonado/6b645dd264bfa3f3f4d3d3da4d2b3c98 to your computer and use it in GitHub Desktop.
Save sjdonado/6b645dd264bfa3f3f4d3d3da4d2b3c98 to your computer and use it in GitHub Desktop.
Install contiki 3.0 in AWS instance

Setup

Install base dependencies

sudo apt update
sudo apt install xfce4 xfce4-goodies
sudo apt install tightvncserver

Setup VNC server

  • Set password
vncserver
vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
  • Create xstartup file
vim ~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
  • Make it executable
chmod +x ~/.vnc/xstartup
  • Restart the VNC server
vncserver -localhost

Running VNC as a System Service

  • Create systemd file
sudo vim /etc/systemd/system/[email protected]
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu

PIDFile=/home/ubuntu/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
  • Make the system aware of the new unit file
sudo systemctl daemon-reload
sudo systemctl enable [email protected]
  • Reload vncserver
vncserver -kill :1
sudo systemctl start vncserver@1
sudo systemctl status vncserver@1

Install contiki dependencies

sudo apt-get install build-essential binutils-msp430 gcc-msp430 msp430-libc msp430mcu mspdebug openjdk-8-jdk openjdk-8-jre ant libncurses5-dev lib32ncurses5 gdb-multiarch

sudo apt-get install avr-libc gcc-avr

Select java version

Option 2: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

sudo update-alternatives --config java

Install contiki

git clone --recurse-submodules --branch 3.0 https://github.com/contiki-os/contiki

Connecting to the VNC Desktop Securely

  • Open ssh tunel
ssh -L 5901:127.0.0.1:5901 -C -N -i ~/.ssh/AWS_PEM AWS_PUBLIC_DNS
  • Open Screen Sharing (macos) using localhost:5901

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment