title: Virtualbox- Cant access to VM when running in Headless mode
body: <p>I installed an <code>ubuntu server</code> with <code>openssh server</code> on a <code>virtualbox</code> and it works fine. when I start it from GUI I can access it via ssh and Putty, there is no problem. When I start it In headless mode from virtualbox gui there is no problem either.</p>
  
  <p>the problem is, when I run it using <code>VBoxManage startvm "Ubuntu" --type headless</code> it returns a message saying that the <code>Ubuntu</code> is running in headless mode but when I want to connect via ssh to it, its not accessable. my host os is windows 10 and the ubuntu server name is "Ubuntu" and os version is <code>ubuntu-16.04.2-server-x64</code> and I installed <code>openssh-server</code> and <code>dkms</code> as it described here: <a href="https://www.htpcbeginner.com/install-virtualbox-guest-additions-on-ubuntu-debian/" rel="nofollow noreferrer">https://www.htpcbeginner.com/install-virtualbox-guest-additions-on-ubuntu-debian/</a></p>
  
  <p>when I work in GUI evrything is fine but I want to run it from windows command line to save some time.</p>
  
  <p>It looks like that the command line vm <code>"Ubuntu"</code> is diffrent from GUI vm <code>"Ubuntu"</code>. But I have only one vm on virtualbox. in gui there is one and in cmd <code>vboxmanage list vms</code> returns one vm. so what is the problem?
  I also added virtualbox guest addition from Device menu in virtualbox GUI</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I saw another command : <code>VBoxHeadless --startvm "Ubuntu"</code> its not working either. but unlike the last command it does not show message that Ubuntu is Running. actually it will stuck in execution and the cursor turns to a blinking dash for ever. so I should close the cmd to get ride of it.</p>
  
  <p>I checked something. If I use NAT on network adapter and port forwarding, it works even from cmd. but when using bridge to avoid using port forwarding its not working. in the bridge mode there is connection and ping is working but cant ssh to the Ubuntu.</p>