Vscode连接远程服务器出现‘Acquiring lock on/home/~’问题

这篇博客介绍了如何处理VSCode在连接远程服务器时遇到的'Acquiring lock on'错误。通过在服务器端使用命令行删除.vscode-server目录,特别是针对.nfs文件的处理,如使用find和lsof命令查找并终止相关进程,然后再彻底删除.vscode-server,可以有效解决该问题。这是一个实用的故障排除指南,旨在帮助开发者快速解决远程开发中的障碍。

简介

利用vscode连接远程服务器效果较好,但是经常出现’Acquiring lock on’问题,做一个总结记录,便于下次问题出现时高效解决

解决方案

在服务器远端(可以使用Mobaxterm)登录,执行下面操作命令,删除掉远端的配置

rm -rf ./home/xxx/.vscode-server

删除时出现问题(删除服务器出现的.nfs文件)
.vscode-server路径下使用命令

find . -name .nfs*

使用命令,查看正在执行情况

lsof ./bin/b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a/.nfs80c808e802ecf94900004a32

在这里插入图片描述

kill -9 PID

全部删除之后再删除.vscode-server

Permission denied, please try again. luyanxi@192.168.111.131's password: 77669bc916f5: running Acquiring lock on /home/luyanxi/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b/vscode-remote-lock.luyanxi.6261075646f055b99068d3688932416f2346dd3b Installing to /home/luyanxi/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b... 77669bc916f5%%1%% Downloading with wget Download complete 77669bc916f5%%2%% tar --version: tar (GNU tar) 1.28 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. Checking /home/luyanxi/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.log and /home/luyanxi/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.pid for a running server Running ssh connection command... /home/luyanxi/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all &> "/home/luyanxi/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.log" < /dev/null printenv: XDG_SESSION_ID=29 SHELL=/bin/bash SSH_CLIENT=192.168.111.1 52776 22 USER=luyanxi VSCODE_AGENT_FOLDER=/home/luyanxi/.vscode-server PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin MAIL=/var/mail/luyanxi PWD=/home/luyanxi LANG=en_US.UTF-8 HOME=/home/luyanxi SHLVL=2 LOGNAME=luyanxi SSH_CONNECTION=192.168.111.1 52776 192.168.111.131 22 XDG_RUNTIME_DIR=/run/user/1000 _=/usr/bin/printenv OLDPWD=/home/luyanxi/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b rm: cannot remove '/home/luyanxi/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.token': No such file or directory Spawned remote server: 119955 Waiting for server log... * * Visual Studio Code Server * * By using the software, you agree to * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement). * 77669bc916f5: start SSH_AUTH_SOCK==== DISPLAY==== webUiAccessToken==== listeningOn==34539== osReleaseId==ubuntu== arch==x86_64== tmpDir==/run/user/1000== platform==linux== unpackResult==success== didLocalDownload==0== downloadTime==29268== installTime==898== extInstallTime==== serverStartTime==37== connectionToken==0663399a-cc4f-42dd-ad0b-dfffba6e47ee== 77669bc916f5: end 这样算是连接成功了吗
07-31
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Fighting_1997

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值