Xshell登陸虛擬機VirtualBox中的Ubuntu方法
- 在官網下載Xshell,選擇Home/School版本,能夠無償使用
- VirtualBox,設置-網絡中選擇橋接網卡,界面名稱選擇virtual adapter那個,以下圖:
![VirtualBox設置 VirtualBox設置](http://static.javashuo.com/static/loading.gif)
- 在Windows系統中,控制面板-網絡和Internet-網絡鏈接中,選中如今已經聯網的網卡(個人是WLAN)和VirtualBox Host-only network,單擊右鍵,選擇橋接,成功後的界面以下圖:
![Windows系統中網絡設置 Windows系統中網絡設置](http://static.javashuo.com/static/loading.gif)
- 登陸虛擬機中的Ubuntu系統,安裝ssh服務,執行
sudo apt install ssh
- 安裝成功後,啓動ssh服務,執行
sudo service ssh start
- 查看ip地址,執行
ifconfig
,以下圖中的 inet addr:192.168.137.13
![Ubuntu中的ip地址 Ubuntu中的ip地址](http://static.javashuo.com/static/loading.gif)
- 打開Xshell,文件-新建會話,名稱中填入虛擬機的名字,主機填入上一步查到的ip,端口號默認22,點擊鏈接,按照提示便可鏈接成功。
- 改爲橋接模式會有一個問題,若是沒有第3步橋接網絡,在Ubuntu啓動的時候,會在一步
a start job is running for the raise network
等待5分鐘,花費很長時間。這是Linux初始化超時形成的,能夠減少等待時間解決(參考 how to fix 「 a start job is running for the raise network 」 in ubuntu server 16.0 LTS)。
歡迎關注本站公眾號,獲取更多信息