2018年1月16日 星期二

VirtualBox principle and practice

1.  How Host -> Guest in  NAT mode by ssh
Hint : Using port forward
host: windows7
guest: centos 6.X

Step1: in guest start the sshd service for sure the service is work
>service sshd start
>netstat -ln | grep 22


Step2: setting the portforward

Notice: the port in NAT will occupy the host port, so we will using another port 6022 to connect to it

Step3: Connect to the quest 

 REF
youtube 


2. Host only network
Host Only 網卡是透過將虛擬機器的網卡和 Host 的綁在(Bind) 由 VirtualBox 所建立的同一張虛擬網卡上的方式來達到虛擬主機可以和 Host 使用相用網段的效果,所以,透過啟用虛擬機器的 Host Only 網卡,就可以讓虛擬主機和 Host 直接存取彼此的服務而不用設定 IP  Forwarding 哩 ! 不過,Host Only 網卡因為是使用了獨立的網段,因此,也就無法直接連到外部的網路來上網哩 !

ref 1

3.  NAT Network start
https://askubuntu.com/questions/691317/virtualbox-dhcp-server

4. Inter network
https://hackercool.com/2013/10/how-to-enable-dhcp-server-in-virtualbox/



5. 其餘網路設定
5-1 . 設定 IPV6
有時候在虛擬機內,因為外部設定成 IPV4, IPV Dual Stack,
但內部未設定, 此時要開啟 IPV6 才能取得 IPV6 address, 否則會有 dns error 等問題








Other reference
virtualbox_manual