開啟命令提示字元
進入你安裝virtualbox的目錄;
cd "c:\Program Files\sun\VirtualBox"
執行以下的指令;
VBoxManage setextradata [Ubuntu] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata [Ubuntu] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata [Ubuntu] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 3456
比較要注意的是"ubuntu"是你安裝在virtualbox上系統的名稱,
port3456則看你自己設定;
設定http連線則複製以上指令,ssh改成http即可.
VBoxManage setextradata [input your vb_name] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP
VBoxManage setextradata [input your vb_name] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 80
VBoxManage setextradata [input your vb_name] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 8000
接著重新執行virtualbox即可,第一次設定請重CMD 下指令 直接修改XML可能會失敗詳細原因尚未查明
以上設定或者到目錄下C:\Users\Administrator\.VirtualBox\Machines\Work\ 找該機器的xml
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/GuestPort" value="21"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/HostPort" value="2121"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" value="8000"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" value="22"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" value="2222"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" value="TCP"/>
在ubuntu預設似乎沒有ssh,
進入root權限,
apt-get install ssh 下載安裝;
FTP相關:
How to get PASV FTP to work behind a NAT router with ProFTPD
啟動虛擬機器 XXX 時失敗。
Configuration error: Failed to get the "MAC" value
(VERR_CFGM_VALUE_NOT_FOUND).
Unknown error creating VM (VERR_CFGM_VALUE_NOT_FOUND)
之類的錯誤訊息
VBoxManage setextradata "Ubuntu904" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
紅字的地方必須根據你的網卡不同而不同,
Intel PRO… (82540em),那應該設成e1000
PCnet-FAST (Am79c973),那就用pcnet
至於你的虛擬網卡會是哪一張呢?就請你自己去你虛擬機器的設定看了~
好像64bits OS預設會配給你e1000;32 bits OS會配給你pcnet
評論
此文章尚無評論。