I am new to Linux OS, I downloaded rpm package from of visual studio code from Microsoft official website.This is the machine
CentOS Linux release 7.6.1810 (Core)
I ran the command
rpm -qpi code-1.40.2-1574694258.el7.x86_64.rpm
Output of the command
Name : code
Version : 1.40.2
Release : 1574694258.el7
Architecture: x86_64
Install Date: (not installed)
Group : Development/Tools
Size : 235084185
License : Multiple, see https://code.visualstudio.com/license
Signature : (none)
Source RPM : code-1.40.2-1574694258.el7.src.rpm
Build Date : Mon 25 Nov 2019 10:04:31 AM EST
Build Host : 2114565cfb42
Relocations : (not relocatable)
Packager : Visual Studio Code Team <[email protected]>
Vendor : Microsoft Corporation
URL : https://code.visualstudio.com/
Summary : Code editing. Redefined.
Description :
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.
Now I want to run the visual studio code as I run in windows machine. How do I achieve this?
Note I have only ssh connection to the linux machine.
4
Answers
You can’t run it via ssh, you need some GUI above the Linux shell.
You can use only command line editors such as; “nano”, “vim” and etc.
Edit:
Alternative You can run VScode on your local machine and connect it via ssh to remote machine.
https://code.visualstudio.com/docs/remote/ssh
you should start by installing the package. You only just queried the package, to install it, you must (as super user) run:
once that is installed, you’ll be able to launch the program by launching the command:
As @Leon.fon noted, if you have only an
ssh
connection, you won’t be able to start a GUI, but exporting your display might work:VSCode is a gui based tool. If you only have ssh acces you could try to run it via x11 forwarding, or setup a VNC connection to remote control the other machine. But as Leon.fon mentioned ssh is usually command line based.
If you want to run a gui based tool via ssh, then you need to pass
-X
(uppercase) argument which enables X11 forwarding,ssh -X remoteHostIP
See following for
http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh.1