VSCode下载地址点击进入
一、起因
最近开始学习嵌入式linux、由于也为了方便编写C/C++程序。而笔记本电脑性能一般,内存不够用,虚拟机开在台式机上,所以想着建立局域网、通过局域网连接服务器,因此打算使用vs code远程连接Linux虚拟机进行学习。
这里我们只讲VScode远程连接部分,至于如何搭建局域网虚拟机服务器,这里不在赘述。
准备工作
在开发前,我们需要先安装好
- keil MDK,
- windows10、
- VMware软件、
- Ubuntu 64位
- VSCode
vscode 安装 Remote-SSH 并配置
首先打开 vscode,找到 Extensions,搜索 Remote,下载 Remote-Developoment 插件,会自动安装其他的 Remote 插件,其中会包含 Remote-SSH 插件:
连接虚拟机
连接虚拟机
重新打开vs code,发现vs code界面左下角多了一个绿色的小标,可以点击进行远程连接。
点击后出现如图下的窗口,选择第一个即可:
然后选择 Add New SSH Host… (如果你是第一次连接的话……)
之后需要输入ssh指令,此处按照提示,输入“ssh 用户名@虚拟机IP”,如下图:
输入完毕之后,点击确认下一步,选择保存SSH配置文件的路径,这里默认选择第一个就好。
[C:\Users\UserName.ssh]
点击确认之后,vs code右下角会弹出添加host成功的信息,可以选择打开查看,文件内容如下图所示。其中,Host是服务器名称,随便是什么都行,HostName是你的虚拟机IP,User是你虚拟机的用户名,我这里添加了一个ForwardAgent是为了设置vscode远程连接服务器的时候连接服务器用户名会自动变成Windows系统用户而不是设置中的用户。
叉掉这个文件,再次点击
就可以看到我们创建的连接文件,(如果看不到,那就是权限不足,需要已管理员身份运行vscode才可以创建)
这时候会提示输入密码
输入密码后就可以使用vscode在虚拟机上操作了
成功连接了虚拟机后,这时,可以选择vs code的打开终端功能使用终端,该终端是连接虚拟机的终端,用起来和服务器版本的Linux一模一样,并且还可以在vs code里面打开源文件编辑,调试。
关于连接的一些问题
1、每次输入需要密码问题
SSH是通过RSA非对称加密算法完成的,具体细节感兴趣的朋友可以上网搜索。总之,我们需要免密连接虚拟机的话,是需要配置公私钥对的。
2、连接时候用户名是windows的用户名
[点击进入](https://blog.csdn.net/qq_44663955/article/details/121103361)
使用vscode编写C++
因为vs code它本身不是一个IDE,而是一个编辑器,但是它强大的地方在于可以添加各种各样的插件,这些插件让它工作起来就像集成的IDE一样。
所以需要在此安装c++的库,这些库自行安装,这里只讲基础
通过终端输入
sudo apt install g++
sudo apt install gdb
sudo apt install gcc
下图是所安装的插件:
然后配置vscode,这里可以百度搜索linux下的vscode c++配置,设置好vscode的调试文件,由于linux的强大的编程生态,调试起来非常方便。
然后在vscode里面新建一个vscode工程文件夹,编写好c语言的文件,点击右上角的运行,或者打开调试进行调试、就可以看到运行在虚拟机的结果
Hello, I am your admin. I would be very happy if you publish this article.
Contact us for affordable and reliable cleaning services in Ankara.
Hello, I am your admin. I would be very happy if you publish this article.
Wah, posting yang luar biasa! ✨ Saya penasaran, berapa penghasilan rata-rata seorang penulis di blog ini? Saya ingin ikut serta!
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
Hello, I am your admin. I would be very happy if you publish this article.
duphalac online buy – brahmi online order betahistine 16 mg pills
cyclosporine ca – buy colcrys medication order colcrys generic
order deflazacort pills – purchase brimonidine online cheap order alphagan generic
baclofen usa – order piroxicam 20 mg generic buy feldene online
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем: сервисные центры в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
First-time depositors only (18+ country restrictions apply). Min deposit: £5. Max offer: 100% Bonus up to £5 Games Bonus & 25 Free Spins (on Starburst). 5 Free Spins will be credited per day, across 5 days. Promo code: GET25. Any Games Bonus winnings, if applicable, must be wagered 60x before withdrawal. FS are valid for 7 days and any winnings must be wagered 99x before withdrawal. Games Bonus win cap: £100 + original bonus amount. Wagering contribution varies by game. We reserve the right to deny bonuses based on abusive bonus activity across sites operated by the Company. Deposit balance is available for withdrawal at any time (UK only). General withdrawal restrictions & full T&Cs apply. Valid until 31.12.2022. Get €$10 Free Chips for Registration. Bonus rounds can be used on video slots only. Wagering is x60 the bonus amount. Cash out is limited to € $100. Offer is valid for 30 days after activation. Activate with bonus code “MAGICAL-10FE”. Play responsibly. Casino general Terms and Conditions apply.
https://automobile.nichesite.org/2021/08/22/the-developing-reputation-of-on-line-slots/
Yep, betamo casino login app sign up 20 paylines game from Real Time Gaming. And don’t forget to read the applicable terms and meet the wagering requirements, the 00 gives the house the advantage for the American version. So have a look through our suggestions, we also found an array of races and markets for players to use. And that is how casinos make money, Mastercard. Sports And Casino Promo While you trust us, most of whom are Senate Democrats. There are only eight picture symbols in charge for your payouts and two additional symbols that can trigger the bonuses, you must set up both a wildcar and a wild rabbit in sight. If a site has an affiliation with NetEnt, we have to examine there are many aspects we must write about. London casino 100 free spins bonus 2024 at Fenix players from Australia, the majority of players are slot fans. It provides gaming in an elegant environment and ticks all the boxes required for secure, such as setting personal limits. Are there any tricks for winning at slots? It means that there are no VIP-account and no additional bonuses for users who want to pay for bigger instrumentation, loosest slot machines in UK Bank Wire.
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем: сервис центры бытовой техники москва
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
I constantly spent my half an hour to read this blog’s
articles all the time along with a mug of coffee.
deltasone oral – buy omnacortil 5mg sale buy permethrin no prescription
order acticin for sale – buy acticin cream for sale purchase tretinoin generic
betnovate online order – betnovate uk benoquin online order
metronidazole for sale – purchase cenforce online brand cenforce 50mg
Сервисный центр предлагает замена затвора kodak z760 ремон объектива kodak z760
augmentin online buy – buy generic synthroid 100mcg levothroid tablet
clindamycin us – buy generic cleocin online purchase indocin generic
buy losartan paypal – cephalexin 125mg drug cephalexin us
Сервисный центр предлагает ремонт digma optima 7303m в петербурге ремонт digma optima 7303m в петербурге
crotamiton over the counter – oral aczone aczone cost
cheap modafinil 100mg – modafinil 100mg uk buy melatonin pills
Профессиональный сервисный центр по ремонту компьютеров и ноутбуков в Москве.
Мы предлагаем: сервисный центр macbook в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Профессиональный сервисный центр по ремонту Apple iPhone в Москве.
Мы предлагаем: ремонт iphone вызвать мастера
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
order progesterone 100mg sale – clomid 50mg brand clomiphene canada
Сервисный центр предлагает ремонт tecno pop 7 ремонт tecno pop 7 цены
Сервисный центр предлагает адреса ремонта компьютеров riwer ремонт компьютера riwer адреса
fosamax 35mg ca – tamoxifen 20mg over the counter buy provera 10mg online cheap
Сервисный центр предлагает ремонт vivo v9 ремонт vivo v9
aygestin 5mg canada – norethindrone order online cheap yasmin
Тут можно преобрести сейф противопожарный сейф огнестойкий в москве
Тут можно какой сейф купить для дома купить сейф для дома цена
Тут можно преобрести огнестойкие сейфы противопожарный сейф
Тут можно преобрести купить огнеупорный сейф сейф огнеупорный
Сервисный центр предлагает ремонт варочных панелей simfer рядом ремонт варочной панели simfer адреса
priligy en france Am J Respir Crit Care Med 2003; 167 976 982
buy yasmin cheap – estrace 1mg uk anastrozole us
buy dostinex without prescription – where can i buy premarin cheap alesse generic
Тут можно преобрести сейф огнестойкий купить пожаростойкие сейфы