Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update idc-desktop.md #56

Open
wants to merge 3 commits into
base: prod
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions cookbook/virtual-machines/idc-desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ 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 \
--image-family=slicer \
--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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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).