VScode连接VMware虚拟机——连接失败

之前一些教程连接之后发现,还是连接不成功,个人认为是ip的问题。后面发现要把虚拟机的ssh打开

查询虚拟机ip

用户名@ubuntu:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.152.128  netmask 255.255.255.0  broadcast 192.168.152.255
        inet6 fe80::f5e9:94e6:6650:5040  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:9d:80:e9  txqueuelen 1000  (Ethernet)
        RX packets 536584  bytes 779853765 (779.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 79092  bytes 5398022 (5.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2894  bytes 663942 (663.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2894  bytes 663942 (663.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

打开虚拟机ssh

liqi@ubuntu:~$ sudo apt-get install -y openssh-server
liqi@ubuntu:~$ sudo /etc/init.d/ssh start
[ ok ] Starting ssh (via systemctl): ssh.service.
liqi@ubuntu:~$ ps -e|grep ssh
  4437 ?        00:00:00 ssh-agent
  9118 ?        00:00:00 sshd

此方法参照

进行连接

按照常规的方法进行连接:
https://blog.csdn.net/qq_46429858/article/details/109470423

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值