Page 1 of 1

Unable to connect to newly made guest from HEADLESS host

Posted: 10. May 2017, 14:39
by Lus1phur
Apologies for this being somewhat of a newb question but I am struggling a bit here.
I have installed virtualbox on my linux server and created a guest in bridged mode. The extension pack is installed and the VRDE server is on. However I am unable to ssh or vnc to the new guest.

I can't even see that the guest has been assigned an IP!

First I can confirm the VM is up ..

Code: Select all

lusiphur@Tenth:~$ sudo VBoxManage list runningvms
"TraderBox1" {a0321d7f-ce62-4104-82a1-d035c16d4392}
but looking at the properties I can't see an ip.

Code: Select all

sudo VBoxManage guestproperty enumerate TraderBox1
Name: /VirtualBox/HostInfo/VBoxVerExt, value: 5.1.22, timestamp: 1494410265539683000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepExec, value: , timestamp: 1494410265538359000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepArgs, value: , timestamp: 1494410265538467000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxRev, value: 115126, timestamp: 1494410265539762000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxVer, value: 5.1.22, timestamp: 1494410265539600000, flags: TRANSIENT, RDONLYGUEST
The VM was set up in bridged mode to eth0

Code: Select all

sudo VBoxManage modifyvm "TraderBox1" --memory 1024 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
Which is the only attached network device on the host

Code: Select all

eth0      Link encap:Ethernet  HWaddr e8:39:35:20:9d:35  
          inet addr:192.168.1.105  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ea39:35ff:fe20:9d35/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:163450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67228 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:62184615 (62.1 MB)  TX bytes:13346575 (13.3 MB)
          Interrupt:18 
When I run the start command I get some alsa errors (expected as their is no sound device) and then the terminal session just hangs. Should it do that if it is starting up cleanly?

Code: Select all

ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
VRDE server is listening on port 3389.
showvminfo is interesting

Code: Select all

NIC 1:           MAC: 080027A15821, Attachment: Bridged Interface 'eth0', Cable connected: off, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
Which suggests it hasn't set up the bridged connection properly, no?

I realise I am probably missing something obvious but any help gratefully appreciated.

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 10. May 2017, 15:22
by Perryg
Shown is the cable is not connected. Use "--cableconnected<1-N> on" to enable it. ( replace <1-N> with the appropriate information )

If you still have issues provide the guests log file ( as an attachment )

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 12:30
by Lus1phur
Cable connected is now on

Code: Select all

NIC 1:           MAC: 080027A15821, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
However, still not seeing an IP and still unable to VNC to the guest.

Code: Select all

lusiphur@Tenth:~$ sudo VBoxManage guestproperty enumerate "TraderBox1"
Name: /VirtualBox/HostInfo/VBoxVerExt, value: 5.1.22, timestamp: 1494498241189194000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepExec, value: , timestamp: 1494498241188167000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepArgs, value: , timestamp: 1494498241188268000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxRev, value: 115126, timestamp: 1494498241189268000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxVer, value: 5.1.22, timestamp: 1494498241189118000, flags: TRANSIENT, RDONLYGUEST
I can't provide a log file as it doesn't appear to be creating one?

Code: Select all

lusiphur@Tenth:~/VirtualBox VMs$ ls -lrt
total 0

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 13:20
by Perryg
You shouldn't need to run as sudo and in fact that may cause your issue. Is your VirtualBox install from the repo fork? If so you would need to ask them or remove theirs and install the official version from virtualbox.org for us to be able to help. The reason I ask is because they use VNC and the official version uses vRDP. Using VNC, while possible requires you to place the login password in the config file unless the repo has figured out a way to bypass this requirement, and the default VNC port is like 5900 and usually not changeable with the settings config file.

As for the guest not getting an IP that can be a lot of things. First using Bridged you would need to have a router in the LAN and depending on the guest it may just be by default that the network does not work. Some do not enable the network stack by default and you need to actually enable it first and make the connection permanent.

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 15:16
by Lus1phur
I followed this guide to install Virtualbox 5.1 and the extensions pack

https://www.howtoforge.com/tutorial/run ... ts-server/

According to that guide I would have pulled from

Code: Select all

deb http://download.virtualbox.org/virtualbox/debian xenial contrib
Which is of course wrong. I want ..

Code: Select all

deb http://download.virtualbox.org/virtualbox/debian trusty contrib
I will clean that up and try again. However, that does suggest I am installing Virtualbox from the official site no?

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 15:28
by Perryg
Maybe but not in all cases. I find the using deb or even apt-get will sometimes pull in the wrong install depending on the actual host OS. I normally download the file from VirtualBox and use dpkg to avoid any conflicts with the distro repo. Also unless you download the actual extension pack from virtualbox.org you are for sure using the repo fork and it will not have the closed source vDP and need what I mentioned above. You can run the commands below to see what is actually installed:

Code: Select all

VBoxManage -v
VBoxManage list extpacks

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 16:12
by Lus1phur
I downloaded the extension pack directly from the Virtualbox site.

Code: Select all

lusiphur@Tenth:~$ VBoxManage -v
5.1.22r115126
lusiphur@Tenth:~$ VBoxManage list extpacks
Extension Packs: 1
Pack no. 0:   Oracle VM VirtualBox Extension Pack
Version:      5.1.22
Revision:     115126
Edition:      
Description:  USB 2.0 and USB 3.0 Host Controller, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe.
VRDE Module:  VBoxVRDP
Usable:       true 
Why unusable: 
That's after I have re-install using the Trusty repo and not the Xenial one.

Further I re-created the guest from scratch not using sudo. Still the same issue in that vnc from my Macbook just times out even though I have allowed 3389 on the host's firewall.

Code: Select all

sudo ufw allow 3389
I note again that the terminal window I ran

Code: Select all

VBoxHeadless --startvm "TraderBox"
is again just hanging at ..

Code: Select all

ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
VRDE server is listening on port 3389.
Should it be holding a terminal session like that?

We now have log files so I have attached that.

It really doesn't look like this is working at all. Am I just uninstalling and then downloading direct from the VirtualBox site?

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 16:23
by Perryg
Should it be holding a terminal session like that?
Yes that is exactly what it is supposed to do.

You continue to use sudo "sudo ufw allow 3389" and as stated that is not what you should be doing. All features should be run as a normal user.

Next you do not use VNC with the guest. You have installed vRDP and they are not compatible. You use the host IP plus the proper port to access the guest for normal use. If you want to use VNC you must set it up properly and that is explained in the users manual but I strongly suggest that you use RDP instead.

Lastly I would never use the default 3389 port because it will conflict with the Windows default port for remote desktop at some point.

Re: Unable to connect to newly made guest from HEADLESS host

Posted: 11. May 2017, 17:25
by Lus1phur
The ufw script only runs under sudo/root.

However, success! Using the Microsoft RDP client for Mac I have managed to connect. I did not appreciate the difference between rdp and vnc and sources on the 'net suggested that for Mac you use vnc.

Thanks for all the help. Much appreciated.