{"id":17354,"date":"2024-11-12T14:27:44","date_gmt":"2024-11-12T19:27:44","guid":{"rendered":"https:\/\/carleton.ca\/scs\/?p=17354"},"modified":"2024-11-12T14:27:44","modified_gmt":"2024-11-12T19:27:44","slug":"vscode-remote-access-and-code-editing","status":"publish","type":"post","link":"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/","title":{"rendered":"vscode: Remote Access and Code Editing"},"content":{"rendered":"<h2>vscode: Remote Access and Code Editing<\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-160x160.png\" alt=\"\" width=\"150\" height=\"150\" class=\"alignright size-thumbnail wp-image-17357\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-160x160.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-240x240.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-400x400.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-768x768.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-200x200.png 200w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1-360x360.png 360w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-1.png 1024w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><br \/>\n<a href=\"#install-vscode\">Step 1: Install vscode<\/a><br \/>\n<a href=\"#install-remote-ssh\">Step 2: Install Remote-SSH Extension<\/a><br \/>\n<a href=\"#create-ssh-connection\">Step 3: Create Remote-SSH Connection<\/a><br \/>\n<a href=\"#open-folder\">Step 4: Open Folder on Remote Server<\/a><br \/>\n<a href=\"#use-vscode-remote\">Step 5: Open a terminal, edit some code, run some code!<\/a><br \/>\n<a href=\"#troubleshooting-vscode-failed-login\">Troubleshooting: Failed Login<\/a><br \/>\n<a href=\"#troubleshooting-vscode-disk-full\">Troubleshooting: Disk Full<\/a><\/p>\n<p>In addition to these instructions, you can find a video tutorial here: <a href=\"https:\/\/youtu.be\/G-nnmjrsM2A\">Video: vscode: Remote Access and Code Editing<\/a><\/p>\n<h3 id=\"install-vscode\">Step 1: Install vscode<\/h3>\n<p>The first thing you need to do is install vscode on your local device (person computer).  We won&#8217;t go into the details of installing it here as it varies depending on your device (Linux, Windows, iOS). The install is usually straight-forward.<br \/>\nThe <strong>vscode<\/strong> download for various platforms can be found here: <a href=\"https:\/\/code.visualstudio.com\/download\">vscode download<\/a><\/p>\n<h3 id=\"install-remote-ssh\">Step 2: Install Remote-SSH Extension<\/h3>\n<p>vscode cannot make remote connections initially.  The <strong>Remote-SSH<\/strong> extension is required<\/p>\n<ol>\n<li>\n<strong>Open vscode<\/strong> and click on the <strong>Extensions<\/strong> panel button (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions.png\" alt=\"\" width=\"932\" height=\"608\" class=\"alignleft size-full wp-image-17365\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions.png 932w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-240x157.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-400x261.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-160x104.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-768x501.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-360x235.png 360w\" sizes=\"(max-width: 932px) 100vw, 932px\" \/>\n<\/li>\n<li>\nClick on the <em>extension search bar<\/em> (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below) and start typing <code>remote ssh<\/code>.<br \/>\nThe <strong>Remote &#8211; SSH<\/strong> extension should appear (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below).<br \/>\nClick on the <strong>Install<\/strong> button (see <span style=\"color:#6c0efd;font-weight:bold;\">Purple Box<\/span> in the image below).<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh.png\" alt=\"\" width=\"776\" height=\"394\" class=\"alignleft size-full wp-image-17366\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh.png 776w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh-240x122.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh-400x203.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh-160x81.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh-768x390.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-extensions-remote-ssh-360x183.png 360w\" sizes=\"(max-width: 776px) 100vw, 776px\" \/>\n<\/li>\n<\/ol>\n<h3 id=\"create-ssh-connection\">Step 3: Create Remote-SSH Connection<\/h3>\n<ol>\n<li>\nA new panel button called <strong>Remote Explorer<\/strong> should appear &#8211; <em>you may have to close and reopen vscode<\/em> (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below).  Click on the <strong>Remote Explorer<\/strong> button.<br \/>\nExpand the tree down until you see the <strong>SSH<\/strong> branch (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below).<br \/>\nClick on the <strong>plus (+)<\/strong> button to begin adding a new SSH connection (see <span style=\"color:#6c0efd;font-weight:bold;\">Purple Box<\/span> in the image below).<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer.png\" alt=\"\" width=\"782\" height=\"475\" class=\"alignleft size-full wp-image-17367\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer.png 782w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer-240x146.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer-400x243.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer-160x97.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer-768x466.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-remote-explorer-360x219.png 360w\" sizes=\"(max-width: 782px) 100vw, 782px\" \/>\n<\/li>\n<li>\nIn the <strong>SSH Connection<\/strong> box that opens (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<br \/>\nEnter <code>ssh student@134.117.130.199<\/code> &#8211; <em>replacing the IP with you own <strong>134.117.#.#<\/strong> IP address<\/em><br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection.png\" alt=\"\" width=\"1006\" height=\"181\" class=\"alignleft size-full wp-image-17440\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection.png 1006w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-240x43.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-400x72.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-160x29.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-768x138.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-360x65.png 360w\" sizes=\"(max-width: 1006px) 100vw, 1006px\" \/>\n<\/li>\n<li>\nIt will ask you to save the connection information to an <em>ssh config file<\/em>.  The default one will vary depending on what operating system you are running.  In general you can select the first option (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2.png\" alt=\"\" width=\"970\" height=\"207\" class=\"alignleft size-full wp-image-17441\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2.png 970w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2-240x51.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2-400x85.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2-160x34.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2-768x164.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-2-360x77.png 360w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/>\n<\/li>\n<li>\nA pop-up will appear saying the host was added.  If you want, you can manually modify the ssh config file by clicking <strong>Open Config<\/strong>.  However, this is not required, and in this case we will just click <strong>Connect<\/strong> (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3.png\" alt=\"\" width=\"672\" height=\"162\" class=\"alignleft size-full wp-image-17442\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3.png 672w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3-240x58.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3-400x96.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3-160x39.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-3-360x87.png 360w\" sizes=\"(max-width: 672px) 100vw, 672px\" \/>\n<\/li>\n<li>\nYou will then be prompted for the password for the <strong>student<\/strong> account (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below).<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4.png\" alt=\"\" width=\"863\" height=\"121\" class=\"alignleft size-full wp-image-17443\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4.png 863w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4-240x34.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4-400x56.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4-160x22.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4-768x108.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-add-ssh-connection-4-360x50.png 360w\" sizes=\"(max-width: 863px) 100vw, 863px\" \/>\n<\/li>\n<li>\nIt will then show a pop-up on the bottom right showing the <strong>vscode-server<\/strong> being added to the remote account.  This make take a few moments to complete.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server.png\" alt=\"\" width=\"666\" height=\"84\" class=\"alignleft size-full wp-image-17445\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server.png 666w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server-240x30.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server-400x50.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server-160x20.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-initializing-vscode-server-360x45.png 360w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/>\n<\/li>\n<li>\nAnd that should complete adding the connection.  A new empty vscode workspace should open that is connected to that remote server.\n<\/li>\n<\/ol>\n<h3 id=\"open-folder\">Step 4: Open Folder on Remote Server<\/h3>\n<ol>\n<li>\nNow that the vscode workspace is connected to the remote server, we need to open a folder.  Click the <strong>Explorer<\/strong> navigation button (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below) and click <strong>Open Folder<\/strong> (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder.png\" alt=\"\" width=\"832\" height=\"284\" class=\"alignleft size-full wp-image-17446\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder.png 832w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-240x82.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-400x137.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-160x55.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-768x262.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-360x123.png 360w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/>\n<\/li>\n<li>\nThe open folder search box will automatically start in the home directory (<code>\/home\/student<\/code>) of the student account, so simply click <strong>OK<\/strong> (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below) unless you want to open a specific sub-folder.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2.png\" alt=\"\" width=\"848\" height=\"193\" class=\"alignleft size-full wp-image-17447\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2.png 848w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2-240x55.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2-400x91.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2-160x36.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2-768x175.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-2-360x82.png 360w\" sizes=\"(max-width: 848px) 100vw, 848px\" \/>\n<\/li>\n<li>\nYou will again be asked to enter the password for the student account (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4.png\" alt=\"\" width=\"840\" height=\"101\" class=\"alignleft size-full wp-image-17448\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4.png 840w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4-240x29.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4-400x48.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4-160x19.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4-768x92.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-4-360x43.png 360w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/>\n<\/li>\n<li>\nA window will pop up asking if you trust the authors of files in this folder.  If a check box is shown to trust all files in the folder &#8216;student&#8217;, check it (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below), although this may not appear in all cases.  Click <strong>Yes, I trust the authors<\/strong> (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below)<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5.png\" alt=\"\" width=\"740\" height=\"575\" class=\"alignleft size-full wp-image-17449\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5.png 740w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5-240x186.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5-400x311.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5-160x124.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-5-360x280.png 360w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/>\n<\/li>\n<li>\nThe <strong>Explorer view<\/strong> will now show all of the files and folders in the student account home directory (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below).<br \/>\n<em><strong>NOTE:<\/strong> The exact content of the directory will vary depending on which course image you are connecting<\/em><br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6.png\" alt=\"\" width=\"580\" height=\"877\" class=\"alignleft size-full wp-image-17450\" style=\"float:none;\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6.png 580w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6-240x363.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6-400x605.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6-160x242.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-folder-6-360x544.png 360w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/>\n<\/li>\n<\/ol>\n<h3 id=\"use-vscode-remote\">Step 5: Open a terminal, edit some code, run some code!<\/h3>\n<ol>\n<li>\nIt can be convenient to open a terminal window so we can run commands just like we would if we had ssh&#8217;d into the system.  You can open a terminal window in many ways.  Here are three easy ones:<\/p>\n<ul style=\"margin-top:0px;\">\n<li>With the <strong>Ctrl + `<\/strong> (Ctrl + backtick) hot key<\/li>\n<li>By right-clicking on any file or folder in the student home directory and clicking <strong>Open in Integrated Terminal<\/strong><\/li>\n<li>By clicking on any file or folder in the student home directory, and going to the <strong>View<\/strong> menu and click <strong>Terminal<\/strong><\/li>\n<\/ul>\n<p>Either of these actions will open a terminal, as seen in the <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal.png\" alt=\"\" width=\"1017\" height=\"625\" class=\"alignleft size-full wp-image-17444\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal.png 1017w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal-240x147.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal-400x246.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal-160x98.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal-768x472.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-ctrl-backtick-terminal-360x221.png 360w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" \/>\n<\/li>\n<li>\nNext, we can <strong>open a file to edit with vscode<\/strong>.  In the example below, we have a folder called <strong>assignment-code<\/strong>, with a python file called <strong>hello-world.py<\/strong> (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below). If you click on the <strong>hello-world.py<\/strong> file, it will open the file in the workspace so you can edit it (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below).<br \/>\n<em><strong>NOTE: <\/strong>If this is the first time you have edited a python file, vscode may helpfully offer to install a python extension to help with you python coding (see <span style=\"color:#6c0efd;font-weight:bold;\">Purple Box<\/span> in the image below).  It will often do this for any programming language that you open for the first time.  It is up to you to decide if you want this extension.  In some cases, your instructor may ask that you install specific extensions with certainly capabilities.  So make sure to check your course notes.<\/em><br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world.png\" alt=\"\" width=\"1084\" height=\"723\" class=\"alignleft size-full wp-image-17451\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world.png 1084w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-240x160.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-400x267.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-160x107.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-768x512.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-360x240.png 360w\" sizes=\"(max-width: 1084px) 100vw, 1084px\" \/>\n<\/li>\n<li>\nWe can use the terminal window to conveniently run commands.  In this example, we manually run the python program <strong>hello-world.py<\/strong>.<\/p>\n<ul>\n<li>First we <strong>cd assignment-code<\/strong> to get into the assignment directory (see <span style=\"color:red;font-weight:bold;\">Red Box<\/span> in the image below)<\/li>\n<li>Then we enter <strong>ls<\/strong> to list the files and make sure we see the <strong>hello-world.py<\/strong> file (see <span style=\"color:#12921d;font-weight:bold;\">Green Box<\/span> in the image below)<\/li>\n<li>Then we run the python file with <strong>python3 hello-world.py<\/strong> and we see the output (it prints <strong><em>Hello, world!&#8221;<\/em><\/strong>) (see <span style=\"color:#6c0efd;font-weight:bold;\">Purple Box<\/span> in the image below)<br \/>\n<em><strong>NOTE: <\/strong>The commands you run to execute code will vary, this is just one example of a possible way of running a python file<\/em>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2.png\" alt=\"\" width=\"1112\" height=\"785\" class=\"alignleft size-full wp-image-17452\" srcset=\"https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2.png 1112w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2-240x169.png 240w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2-400x282.png 400w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2-160x113.png 160w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2-768x542.png 768w, https:\/\/carleton.ca\/scs\/wp-content\/uploads\/vscode-open-hello-world-2-360x254.png 360w\" sizes=\"(max-width: 1112px) 100vw, 1112px\" \/>\n<\/li>\n<\/ol>\n<h3 id=\"troubleshooting-vscode-failed-login\">Troubleshooting: Failed Login<\/h3>\n<p><strong>vscode<\/strong> failed logins are most often caused by two things:<\/p>\n<ol>\n<li><strong>New Openstack Instance with Expired Password:<\/strong> New openstack instances have a default username and password, and the password is expired and must be changed.  This cannot be done through the vscode remote connection interface, so you must use a different <a href=\"https:\/\/carleton.ca\/scs\/tech-support\/scs-open-stack\/openstack-technical-support\/openstack-step-by-step-guide\/#openstack-connect-to-instance\">Connection Tool<\/a> to connect to your instance for the first time.  Once you have set a new password, you can use vscode normally.<\/li>\n<li><strong>Instance Disk Full:<\/strong> If an instance&#8217;s disk drive fills up, it will not be possible to login with vscode as the tool needs to setup temporary files to initialize.  The indicator of this problem is (usually): when you enter the password, vscode will hang, sometimes showing an <em>installing vscode server<\/em> message that never goes away.  If you see that behavior, it is likely that the disk is full.  You must login with another <a href=\"https:\/\/carleton.ca\/scs\/tech-support\/scs-open-stack\/openstack-technical-support\/openstack-step-by-step-guide\/#openstack-connect-to-instance\">Connection Tool<\/a>, free up some disk space, and then return to using vscode.\n<\/ol>\n<h3 id=\"troubleshooting-vscode-disk-full\">Troubleshooting: Disk Full<\/h3>\n<p><strong>vscode<\/strong> installs a lot of libraries and support tools to make you coding easier.  It also stores a cache of all the original downloaded installers, which it keeps even after the tool has been successfully added to vscode.  It is quite common for all of this to quickly fill an openstack instance&#8217;s disk drive.  Check with your course instructor for instructions on how to clear the vscode cache as it can vary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vscode: Remote Access and Code Editing Step 1: Install vscode Step 2: Install Remote-SSH Extension Step 3: Create Remote-SSH Connection Step 4: Open Folder on Remote Server Step 5: Open a terminal, edit some code, run some code! Troubleshooting: Failed Login Troubleshooting: Disk Full In addition to these instructions, you can find a video tutorial [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","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":""},"categories":[58,99,65,57,59],"tags":[107,106,105,104,103],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>vscode: Remote Access and Code Editing - School of Computer Science<\/title>\n<meta name=\"description\" content=\"vscode: Remote Access and Code Editing Step 1: Install vscode Step 2: Install Remote-SSH Extension Step 3: Create Remote-SSH Connection Step 4: Open\" \/>\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\/scs\/2024\/vscode-remote-access-and-code-editing\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"andrewpullin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/\",\"url\":\"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/\",\"name\":\"vscode: Remote Access and Code Editing - School of Computer Science\",\"isPartOf\":{\"@id\":\"https:\/\/carleton.ca\/scs\/#website\"},\"datePublished\":\"2024-11-12T19:27:44+00:00\",\"dateModified\":\"2024-11-12T19:27:44+00:00\",\"author\":{\"@id\":\"https:\/\/carleton.ca\/scs\/#\/schema\/person\/165b37967ff02be20bc30ba4ef56e96d\"},\"description\":\"vscode: Remote Access and Code Editing Step 1: Install vscode Step 2: Install Remote-SSH Extension Step 3: Create Remote-SSH Connection Step 4: Open\",\"breadcrumb\":{\"@id\":\"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/carleton.ca\/scs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Technical Support\",\"item\":\"https:\/\/carleton.ca\/scs\/category\/technicalsupport\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Openstack\",\"item\":\"https:\/\/carleton.ca\/scs\/category\/technicalsupport\/openstack-support\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"vscode: Remote Access and Code Editing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/carleton.ca\/scs\/#website\",\"url\":\"https:\/\/carleton.ca\/scs\/\",\"name\":\"School of Computer Science\",\"description\":\"Carleton University\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/carleton.ca\/scs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/carleton.ca\/scs\/#\/schema\/person\/165b37967ff02be20bc30ba4ef56e96d\",\"name\":\"andrewpullin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/carleton.ca\/scs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f7e292566dc80625455ee84f24686363?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f7e292566dc80625455ee84f24686363?s=96&d=mm&r=g\",\"caption\":\"andrewpullin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"vscode: Remote Access and Code Editing - School of Computer Science","description":"vscode: Remote Access and Code Editing Step 1: Install vscode Step 2: Install Remote-SSH Extension Step 3: Create Remote-SSH Connection Step 4: Open","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\/scs\/2024\/vscode-remote-access-and-code-editing\/","twitter_misc":{"Written by":"andrewpullin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/","url":"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/","name":"vscode: Remote Access and Code Editing - School of Computer Science","isPartOf":{"@id":"https:\/\/carleton.ca\/scs\/#website"},"datePublished":"2024-11-12T19:27:44+00:00","dateModified":"2024-11-12T19:27:44+00:00","author":{"@id":"https:\/\/carleton.ca\/scs\/#\/schema\/person\/165b37967ff02be20bc30ba4ef56e96d"},"description":"vscode: Remote Access and Code Editing Step 1: Install vscode Step 2: Install Remote-SSH Extension Step 3: Create Remote-SSH Connection Step 4: Open","breadcrumb":{"@id":"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/carleton.ca\/scs\/2024\/vscode-remote-access-and-code-editing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/carleton.ca\/scs\/"},{"@type":"ListItem","position":2,"name":"Technical Support","item":"https:\/\/carleton.ca\/scs\/category\/technicalsupport\/"},{"@type":"ListItem","position":3,"name":"Openstack","item":"https:\/\/carleton.ca\/scs\/category\/technicalsupport\/openstack-support\/"},{"@type":"ListItem","position":4,"name":"vscode: Remote Access and Code Editing"}]},{"@type":"WebSite","@id":"https:\/\/carleton.ca\/scs\/#website","url":"https:\/\/carleton.ca\/scs\/","name":"School of Computer Science","description":"Carleton University","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/carleton.ca\/scs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/carleton.ca\/scs\/#\/schema\/person\/165b37967ff02be20bc30ba4ef56e96d","name":"andrewpullin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/carleton.ca\/scs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f7e292566dc80625455ee84f24686363?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f7e292566dc80625455ee84f24686363?s=96&d=mm&r=g","caption":"andrewpullin"}}]}},"acf":{"Post Thumbnail Icon":"","Post Thumbnail":false},"_links":{"self":[{"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/posts\/17354"}],"collection":[{"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/comments?post=17354"}],"version-history":[{"count":3,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/posts\/17354\/revisions"}],"predecessor-version":[{"id":19711,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/posts\/17354\/revisions\/19711"}],"wp:attachment":[{"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/media?parent=17354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/categories?post=17354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carleton.ca\/scs\/wp-json\/wp\/v2\/tags?post=17354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}