diff --git a/cookbook/virtual-machines/idc-desktop.md b/cookbook/virtual-machines/idc-desktop.md index 7c0d027..508d318 100644 --- a/cookbook/virtual-machines/idc-desktop.md +++ b/cookbook/virtual-machines/idc-desktop.md @@ -12,12 +12,18 @@ The instructions here are just a starting point. There are many cloud options av In order to follow these instructions, you will need to have a project that has billing enabled. Please follow the instructions in [getting-started-with-gcp.md](../../introduction/google-cloud-platform/getting-started-with-gcp.md "mention") to set up billing. {% endhint %} +Note that the disk images are based on Ubuntu 20.04 and are not regularly patched, so updating the OS right after booting is suggested. + +If you run into an error updating the OS you may need to update the keys with this command: `sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B53DC80D13EDEF05`. + ## With a GPU -You can launch a VM with a GPU in your project with a command like this in your local terminal (replace `vm-name` with a name for your machine): +You can launch a VM with a GPU in your project with a command like this in your local terminal (e.g. replace `vm-name` with a name for your machine): ``` export VMNAME=vm-name +export PROJECT=project-name +export ZONE="us-east1-a" gcloud compute instances create ${VMNAME} \ --machine-type=n1-standard-8 \ --accelerator=type=nvidia-tesla-k80,count=1 \ @@ -25,7 +31,9 @@ gcloud compute instances create ${VMNAME} \ --image-project=idc-sandbox-000 \ --boot-disk-size=200GB \ --boot-disk-type=pd-balanced \ - --maintenance-policy=TERMINATE + --maintenance-policy=TERMINATE \ + --zone=${ZONE} \ + --project=${PROJECT} ``` Once it boots in about 90 seconds you can type: @@ -57,7 +65,7 @@ Once it boots in about 90 seconds you can type: gcloud compute ssh ${VMNAME} -- -L 6080:localhost:6080 ``` -On the remote machine run: +On the remote machine run these commands once (first time you boot): ``` # these are on-time installs @@ -66,7 +74,7 @@ sudo apt-get update sudo apt-get -y install tigervnc-standalone-server websockify ``` -Each time you reboot the machine, run this: +Then run these commands, which will also need to be rerun every time you reboot the machine: ``` vncserver -xstartup xfce4-session @@ -77,6 +85,8 @@ nohup websockify --web /opt/novnc/noVNC/ 6080 localhost:5901 & Then you can open [http://localhost:6080/vnc.html?autoconnect=true](http://localhost:6080/vnc.html?autoconnect=true) to get to your desktop. +Note that when you log out from your ssh session in your local terminal you may need to type Control-C if the VCN session is still connected via the tunnel. + ## Note This effort is a work in progress with a minimal desktop environment. Further refinement is expected and community contributions would be welcome! A description of the background and possible evolution of this work is [in this document](https://docs.google.com/document/d/1jfHqjS7Fer7Lhqea5bjyown0b04AsqeOhIBY2gWUDO4/edit).