{"id":933,"date":"2024-10-21T10:24:11","date_gmt":"2024-10-21T14:24:11","guid":{"rendered":"https:\/\/carleton.ca\/rcs\/?page_id=933"},"modified":"2024-10-21T15:40:50","modified_gmt":"2024-10-21T19:40:50","slug":"connecting-to-rcdc-using-vs-code-windows","status":"publish","type":"page","link":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/","title":{"rendered":"Connecting to RCDC using VS Code (Windows)"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also upload\/download files, and open a shell command session on the Linux server.<\/p>\n<p>To make a secure and more convenient connection to the server we will use SSH keys, which enables a remote session without repeatedly typing in your password.<\/p>\n<h2>Initial Configuration<\/h2>\n<ol>\n<li>Ensure that the OpenSSH Client is installed on your Windows laptop.\u00a0 It is probably already there, but if not you can install it in your Windows Settings at Apps &gt; Apps and Features &gt; Manage Optional Features<\/li>\n<li>The server is not publicly accessible, so if you are off-campus or on wireless, connect to the <a href=\"https:\/\/carleton.ca\/its\/help-centre\/remote-access\/\">Carleton VPN<\/a>.<\/li>\n<li>In VS Code, install the <a class=\"install-extension-btn\" href=\"vscode:extension\/ms-vscode-remote.remote-ssh\">Remote &#8211; SSH extension<\/a><\/li>\n<li>In VS Code, connect to the server by pressing the Remote Window button in the bottom left:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-939 alignnone\" src=\"https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-remote-button.png\" alt=\"\" width=\"276\" height=\"137\" srcset=\"https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-remote-button.png 276w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-remote-button-240x119.png 240w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-remote-button-160x79.png 160w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><br \/>\nselect Connect to host&#8230;<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-940 \" src=\"https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host.png\" alt=\"\" width=\"533\" height=\"105\" srcset=\"https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host.png 1210w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host-240x47.png 240w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host-400x79.png 400w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host-160x31.png 160w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host-768x151.png 768w, https:\/\/carleton.ca\/rcs\/wp-content\/uploads\/vscode-connect-to-host-360x71.png 360w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><br \/>\nFor your username and IP address, type <em>ssh u&#115;&#101;&#x72;&#x6e;&#x61;&#x6d;e&#64;&#49;&#51;&#x34;&#x2e;&#x31;17&#46;&#50;&#x31;&#x34;&#x2e;XX<\/em><br \/>\nA new Code window will open, and it will ask you for your password.\u00a0 Type in the provided password.\u00a0 You might be asked for your password again until you have installed the ssh key on your server!<\/li>\n<li>Create an SSH Key on your Windows laptop by running this in a Command Prompt:<br \/>\n<em>ssh-keygen -t ed25519<\/em><\/li>\n<li>In a VS Code remote server session, press CTRL-` to start a remote shell terminal, and run these commands:<br \/>\n<em>mkdir -p ~\/.ssh<\/em><br \/>\n<em>chmod 700 ~\/.ssh<\/em><br \/>\n<em>touch ~\/.ssh\/authorized_keys<\/em><br \/>\n<em>chmod 600 ~\/.ssh\/authorized_keys<\/em><\/li>\n<li>In VS Code, open the <em>.ssh\/authorized_keys<\/em> file on the server, and paste the contents of the following file from\u00a0 your local Windows laptop: <em>%USERPROFILE%\\.ssh\\id_ed25519.pub<\/em><\/li>\n<\/ol>\n<p>After these steps have been successfully completed, you should be able to use develop code on the server.\u00a0 To reconnect later, you will need to ensure the VPN is running, and then connect to the server again.<\/p>\n<h2>Running code while disconnected<\/h2>\n<p>A common purpose for the Linux server is to provide you with a place that you can run code which takes a long time to complete.\u00a0 For this, you will need to use special Linux commands to start your code.<\/p>\n<p>One suggested command is Task Spooler.\u00a0 In your remote session in VS Code, press CTRL-` to open a shell and then use the commands described here:<\/p>\n<p><a href=\"https:\/\/carleton.ca\/rcs\/rcdc\/background-queue-of-jobs\/\">Background queue of jobs<\/a><\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also upload\/download files, and open a shell command session on the Linux server. To make a secure and more convenient connection to the server we will use SSH keys, [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"parent":96,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","_mi_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Connecting to RCDC using VS Code (Windows) - Research Computing Services<\/title>\n<meta name=\"description\" content=\"Overview The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/\",\"url\":\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/\",\"name\":\"Connecting to RCDC using VS Code (Windows) - Research Computing Services\",\"isPartOf\":{\"@id\":\"https:\/\/carleton.ca\/rcs\/#website\"},\"datePublished\":\"2024-10-21T14:24:11+00:00\",\"dateModified\":\"2024-10-21T19:40:50+00:00\",\"description\":\"Overview The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also\",\"breadcrumb\":{\"@id\":\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/carleton.ca\/rcs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Research Computing and Development Cloud (RCDC)\",\"item\":\"https:\/\/carleton.ca\/rcs\/rcdc\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Connecting to RCDC using VS Code (Windows)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/carleton.ca\/rcs\/#website\",\"url\":\"https:\/\/carleton.ca\/rcs\/\",\"name\":\"Research Computing Services\",\"description\":\"Carleton University\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/carleton.ca\/rcs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Connecting to RCDC using VS Code (Windows) - Research Computing Services","description":"Overview The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/","url":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/","name":"Connecting to RCDC using VS Code (Windows) - Research Computing Services","isPartOf":{"@id":"https:\/\/carleton.ca\/rcs\/#website"},"datePublished":"2024-10-21T14:24:11+00:00","dateModified":"2024-10-21T19:40:50+00:00","description":"Overview The Visual Studio Code editor is able to connect to a Linux server using SSH, to remotely edit, run, and debug code.\u00a0 VS Code can also","breadcrumb":{"@id":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/carleton.ca\/rcs\/rcdc\/connecting-to-rcdc-using-vs-code-windows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/carleton.ca\/rcs\/"},{"@type":"ListItem","position":2,"name":"Research Computing and Development Cloud (RCDC)","item":"https:\/\/carleton.ca\/rcs\/rcdc\/"},{"@type":"ListItem","position":3,"name":"Connecting to RCDC using VS Code (Windows)"}]},{"@type":"WebSite","@id":"https:\/\/carleton.ca\/rcs\/#website","url":"https:\/\/carleton.ca\/rcs\/","name":"Research Computing Services","description":"Carleton University","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/carleton.ca\/rcs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"}]}},"acf":{"banner_image_type":"none","banner_button":"no"},"_links":{"self":[{"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/pages\/933"}],"collection":[{"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":4,"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/pages\/933\/revisions"}],"predecessor-version":[{"id":943,"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/pages\/933\/revisions\/943"}],"up":[{"embeddable":true,"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/pages\/96"}],"wp:attachment":[{"href":"https:\/\/carleton.ca\/rcs\/wp-json\/wp\/v2\/media?parent=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}