john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Virtualbox port forwarding debian guest

johnpfeifer 02may09

VBoxManage createvm -name "debian5" -register VBoxManage createhd -filename "debian5.vdi" -size 2000 -register VBoxManage modifyvm "debian5" -hda "debian5.vdi"

VBoxManage openmedium dvd /full/path/to/iso.iso VBoxManage modifyvm "debian5" -dvd /full/path/to/iso.iso VBoxManage modifyvm "debian5" -memory "512MB" -acpi on -boot1 dvd -nic1 nat vboxmanage modifyvm vmname -bioslogofadein off -bioslogofadeout off -biosbootmenu disabled vboxmanage showvminfo "debian5"


VBoxManage setextradata "vmname" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP VBoxManage setextradata "vmname" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22 VBoxManage setextradata "vmname" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222

Modify the vrdpport - which is always enabled in headless (unless explicitly disabled) vboxmanage modifyvm vmname --vrdpport

and to setup headless to not interfere with existing RDP... (the guest accessed via ssh) VBoxHeadless -startvm --vrdp=off


notepad start-vm.bat c:\progra~1\sun\xvmvir~1\vboxheadless -startvm vmname --vrdp=off

notepad stop-vm.bat c:\progra~1\sun\xvmvir~1\vboxmanage controlvm vmname poweroff


host-interface (now again called "bridging") allows the guest full access to all of the ports of the host. (which sometimes requires vbox to be reinstalled or repaired for it to work properly)

NAT with forwarding can be more secure as only 1 port on the guest is exposed.

vbox NAT note: Forwarding host ports < 1024 impossible: On Unix-based hosts (e.g. Linux, laris, MacOS X) it is not possible to bind to ports below 1024 from application that are not run by root. As a result, if you try to con?gure such a port forwa ing, the VM will refuse to start.

VBoxManage getextradata Fedora5 installdate or in this case vboxmanage getextradata


  • « Virtualbox PXE booting with NAT
  • Virtualbox physical ms terminal server to virtual »

Published

Feb 6, 2010

Category

virtualization

~224 words

Tags

  • debian 10
  • forwarding 3
  • guest 11
  • port 10
  • virtualbox 36
  • virtualization 87