無法透過 Windows RDP 連接到我的 Ubuntu 伺服器上的 Vbox 虛擬機

無法透過 Windows RDP 連接到我的 Ubuntu 伺服器上的 Vbox 虛擬機

我有一個 ubuntu 18.x 伺服器。我在伺服器上安裝了 virtualbox 並使用配置了一個新的虛擬機這些說明。當我嘗試最後一步時,出現錯誤視窗 在此輸入影像描述

我還注意到,當我運行 netstat 時,與我的虛擬機器連接埠關聯的 IP 是 0.0.0.0

但是當我nmap在我的伺服器 IP 上運行時,我得到了這個

PORT     STATE SERVICE
22/tcp   open  ssh
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
5001/tcp open  commplex-link

最後一行是我的虛擬機器的連接埠號碼這是輸出$ VboxManage showvmdetails tails(比教學範例詳細得多)


Name:                        tails
Groups:                      /
Guest OS:                    Linux 2.6 / 3.x / 4.x (32-bit)
UUID:                        7107a87f-4ffb-4c80-9cf9-0bc3ff6c6b4c
Config file:                 /var/vbox/tails/tails.vbox
Snapshot folder:             /var/vbox/tails/Snapshots
Log folder:                  /var/vbox/tails/Logs
Hardware UUID:               7107a87f-4ffb-4c80-9cf9-0bc3ff6c6b4c
Memory size                  1024MB
Page Fusion:                 disabled
VRAM size:                   8MB
CPU exec cap:                100%
HPET:                        disabled
CPUProfile:                  host
Chipset:                     piix3
Firmware:                    BIOS
Number of CPUs:              1
PAE:                         enabled
Long Mode:                   disabled
Triple Fault Reset:          disabled
APIC:                        enabled
X2APIC:                      enabled
Nested VT-x/AMD-V:           disabled
CPUID Portability Level:     0
CPUID overrides:             None
Boot menu mode:              message and menu
Boot Device 1:               DVD
Boot Device 2:               DVD
Boot Device 3:               HardDisk
Boot Device 4:               Not Assigned
ACPI:                        enabled
IOAPIC:                      disabled
BIOS APIC mode:              APIC
Time offset:                 0ms
RTC:                         local time
Hardw. virt.ext:             enabled
Nested Paging:               enabled
Large Pages:                 disabled
VT-x VPID:                   enabled
VT-x unr. exec.:             enabled
Paravirt. Provider:          Default
Effective Paravirt. Prov.:   KVM
State:                       running (since 2019-12-11T04:49:39.483000000)
Monitor count:               1
3D Acceleration:             disabled
2D Video Acceleration:       disabled
Teleporter Enabled:          disabled
Teleporter Port:             0
Teleporter Address:          
Teleporter Password:         
Tracing Enabled:             disabled
Allow Tracing to Access VM:  disabled
Tracing Configuration:       
Autostart Enabled:           disabled
Autostart Delay:             0
Default Frontend:            
Storage Controller Name (0):            tails_SATA
Storage Controller Type (0):            IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  30
Storage Controller Port Count (0):      30
Storage Controller Bootable (0):        on
tails_SATA (0, 0): /tmp/tails-amd64-4.1.iso (UUID: b48d5261-170d-4bc8-a1d6-2ee18c29051f)
tails_SATA (1, 0): /var/box/tails.vdi (UUID: 94e4ba64-b33d-4cdf-a37f-959ccd3dcffb)
NIC 1:                       MAC: 080027B4FB40, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:                       disabled
NIC 3:                       disabled
NIC 4:                       disabled
NIC 5:                       disabled
NIC 6:                       disabled
NIC 7:                       disabled
NIC 8:                       disabled
Pointing Device:             PS/2 Mouse
Keyboard Device:             PS/2 Keyboard
UART 1:                      disabled
UART 2:                      disabled
UART 3:                      disabled
UART 4:                      disabled
LPT 1:                       disabled
LPT 2:                       disabled
Audio:                       enabled (Driver: ALSA, Controller: AC97, Codec: STAC9700)
Audio playback:              disabled
Audio capture:               disabled
Clipboard Mode:              disabled
Drag and drop Mode:          disabled
Session name:                headless
Video mode:                  720x400x0 at 0,0 enabled
VRDE:                        enabled (Address 0.0.0.0, Ports 5001, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
VRDE port:                   5001
Video redirection:           disabled
VRDE property               : TCP/Ports  = "5001"
VRDE property               : TCP/Address = <not set>
OHCI USB:                    disabled
EHCI USB:                    disabled
xHCI USB:                    disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:<none>

VRDE Connection:             not active
Clients so far:              0

Capturing:                   not active
Capture audio:               not active
Capture screens:             
Capture file:                /var/vbox/tails/tails.webm
Capture dimensions:          1024x768
Capture rate:                512kbps
Capture FPS:                 25kbps
Capture options:             

Guest:

Configured memory balloon size: 0MB
OS type:                     Linux26
Additions run level:         0

Guest Facilities:

No active facilities.



如何修復此問題以透過 RDP 連接到我的虛擬機器?我真的不知道從哪裡開始。我是一名軟體開發人員,通常我可以從錯誤中推斷出一些訊息,但這並不能告訴我任何訊息。問題出在伺服器端嗎?在主機端?我的網路配置?虛擬盒子設定?我的 Windows 權限?我到處尋找一條可以遵循的道路。我對網路了解不夠,所以我來這裡尋求幫助。我也在 Superuser 和 Serverfault 上發帖,但沒有收到任何回复

答案1

以下遇到了同樣的問題導遊你用過。執行以下操作來解決該問題:


啟用多重連線

sudo VBoxManage modifyvm ubuntu16 --vrdemulticon on

允許連接埠 5001

sudo ufw allow 5001/tcp

重啟

sudo VBoxManage controlvm ubuntu16 savestate
sudo reboot
sudo VBoxManage startvm ubuntu16 --type headless

最後可以打開微軟遠端桌面輸入IP位址和連接埠

PC name: 192.107.123.12:5001

連接遠端桌面的螢幕截圖

上面的內容在帶有 Virtual Box 5.2.44 的 Ubuntu 18.04 伺服器上對我有用。 Think 也應該可以在帶有 Virtual Box 6.1 的 Ubuntu 16.04 上運行。

希望它能有所幫助!

答案2

事實證明,您使用的是舊的、有缺陷的 vbox 擴充包版本。您將有相同的更新。這裡是下載頁面的連結。

下載頁面

相關內容