您的位置:首页 > 产品设计 > UI/UE

Setting VirtualBox to use it's built-in VNC server (ver. >= 4.2 I think) - failed

2016-06-14 17:19 507 查看
20150423 - Set VirtualBox to use it's built-in VNC server.

http://www.neatlittleinsights.com/htdocs/set_virtualbox_to_use_builtin_vnc_server.html

Setting VirtualBox to use it's built-in VNC server (ver. >= 4.2 I think)

Any and all information on this website is for entertainment purposes only.

Last updated 2015 04 23

This will allow you to set a vbox vm to have the "console" display sent out over a VNC server.

The first step is to globally enable the VNC extension pack like this:

----------------

// http://mirror.hactar.bz/community/os/x86_64/virtualbox-ext-vnc-5.0.20-1-x86_64.pkg.tar.xz
// download virtualbox-ext-vnc-5.0.20-1-x86_64.pkg.tar.xz  then unzip

// in VirtualBox GUI, install "VNC-5.0.20.vbox-extpack"

----------------

//// VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.0.20-106931.vbox-extpack

//// VBoxManage list extpacks

//// VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"

----------------

    vboxmanage setproperty vrdeextpack VNC

Then set a password to use from the VNC client (I had to do this, not setting a password prevented me from connecting even when trying what was referred to as the "default" VNC password):

    vboxmanage modifyvm android-x86-6.0-rc1 --vrdeproperty VNCPassword=123456

Then turn vrde on for that same vm:

    vboxmanage modifyvm android-x86-6.0-rc1 --vrde on

Then you can start the vm like this:

    vboxmanage startvm android-x86-6.0-rc1 --type headless

This will start the vm and return you to the prompt, but with the vm starting up in the background (and it will output a message telling you the vm successfully started - NOTE that it means that is started booting successfully, NOT that it started up all the
way successfully). This will leave a VNC server running on the "default" port, which I think was 5900, you can check with netstat -ltdaun | grep LISTEN to see what port(s) are listening for connections. I always set a specific/unique port for each vm so none
are stepping on each other's toes with this command before starting up the vm:

    netstat -ltdaun | grep LISTEN

    vboxmanage modifyvm android-x86-6.0-rc1 --vrdeport 5906

Use whatever tcp port you want beyond 5903 or so, and when you connect from a VNC client remember to use the VirtualBox host's IP to connect to, not the vm's IP, especially since when it first starts booting it doesn't have an IP yet. This means you can tunnel
your VNC traffic through an SSH tunnel like this too: ssh -L 3300:localhost:5906 192.168.1.105 assuming your vm host is 105, then tell the VNC client to connect to localhost:3300 instead of the IP of the vm host.

I start at about 5906 to give room to other vms as well as the vm host to run VNC servers if necessary, and so that a new vm won't accidentally step on a running vm's toes if someone forgets to change the vnc server port from the default.

I also noticed with netstat output that this starts something listening on tcp port 3389 as well as whatever tcp port specified in the command above (like 5906) and it seems it is a vnc server as well (not an rdp server which you might think based on the port
being 3389).

I also found that this works in the virtualbox package you can install in Ubuntu 14.04 LTS with sudo apt-get install virtualbox but older version of VirtualBox like from Ubuntu 10.04 don't seem to have this VNC vrde extension pack available.

Back to main page.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: