From 406df6215a2b873a8a7d2845130f5f619491d4b3 Mon Sep 17 00:00:00 2001 From: Steve Pieper Date: Tue, 18 Apr 2023 15:32:41 -0400 Subject: [PATCH 1/2] Update idc-desktop.md Suggestions from @wlongabaugh --- cookbook/virtual-machines/idc-desktop.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cookbook/virtual-machines/idc-desktop.md b/cookbook/virtual-machines/idc-desktop.md index e68032c..ec1e47b 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 a 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/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="use-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 sudo systemctl stop novnc @@ -65,7 +73,7 @@ sudo apt-get update sudo apt-get -y install tigervnc-standalone-server websockify ``` -Each time you reboot the machine, run this: +Each time you reboot the machine, run these commands: ``` vncserver -xstartup xfce4-session # here you will be prompted for a password for vnc if you haven't already From 24bdcd07eb993fc7507c3f2b16bef079e01c1068 Mon Sep 17 00:00:00 2001 From: Steve Pieper Date: Wed, 19 Apr 2023 10:43:37 -0400 Subject: [PATCH 2/2] Update idc-desktop.md Add suggested wording from @wlongabaugh --- cookbook/virtual-machines/idc-desktop.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbook/virtual-machines/idc-desktop.md b/cookbook/virtual-machines/idc-desktop.md index ec1e47b..ea6bae9 100644 --- a/cookbook/virtual-machines/idc-desktop.md +++ b/cookbook/virtual-machines/idc-desktop.md @@ -23,7 +23,7 @@ You can launch a VM with a GPU in your project with a command like this in your ``` export VMNAME=vm-name export PROJECT=project-name -export ZONE="use-east1-a" +export ZONE="us-east1-a" gcloud compute instances create ${VMNAME} \ --machine-type=n1-standard-8 \ --accelerator=type=nvidia-tesla-k80,count=1 \ @@ -73,7 +73,7 @@ sudo apt-get update sudo apt-get -y install tigervnc-standalone-server websockify ``` -Each time you reboot the machine, run these commands: +Then run these commands, which will also need to be rerun every time you reboot the machine: ``` vncserver -xstartup xfce4-session # here you will be prompted for a password for vnc if you haven't already @@ -84,5 +84,7 @@ 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).