VirtualBox network / study environment setup for RHEL

Posted scruffybear

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VirtualBox network / study environment setup for RHEL相关的知识,希望对你有一定的参考价值。

I re-visited the RHEL study material and setup the environment again, noted down the procedure.

1, copied the *.vdi (rhel6std.vdi and RHEL6-Student.vdi) file from Lenovo ThinkPad T400 to my new Lenovo ThinkPad X1, created the new machine by importing the *.vdi, no need to install the system again.

2, setup the network at Linux Instructor and Linux Student
In VirtualBox Manager, File->Preferences...->Network, to create "VirtualBox Host-Only Ethernet Adapter #2" and "VirtualBox Host-Only Ethernet #3".
The Adapter #2 leave it as default,
技术分享
The Adapter #3 set as below, server address allocated as 192.168.18.100, server mask as 255.255.255.0, address range as 192.168.18.101 ~ 192.168.18.254:
技术分享
In Linux-student->Machine->Settings, set as below,
技术分享
In Linux-Instructor->Machine->Settings, set as below,
技术分享
In Windows, the network configuration as below,
技术分享
Network configuration on Linux-Instructor, as I cloned the machine, I didn‘t change anything and tried to test the network connection, but failed, the configuration as below,
/etc/sysconfig/network-scripts/glsorig-ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
DNS1="192.168.0.254"
HOSTNAME="instructor.example.com"
HWADDR="00:0C:29:65:C0:CE"
IPADDR="192.168.0.254"
MTU="1500"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"

/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
BOOTPROTO=none
IPADDR=192.168.0.254
NETMASK=255.255.255.0
DNS1=192.168.0.254
HOSTNAME="instructor.example.com"
IPV6INIT=no
NAME="Bridge eth0"
NM_CONTROLLED=no
ONBOOT=yes
PEERNTP="no"
DELAY=0
TYPE=Bridge
USERCTL=no

/etc/sysconfig/network-scripts/ifcfg-br0:0
# gls remote.test interface
DEVICE=br0:0
IPADDR=192.168.1.254
NETMASK=255.255.255.0
TYPE=Ethernet
BOOTPROTO=none
IPV6INIT=no
USERCTL=no

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
DNS1=192.168.0.254
HOSTNAME="instructor.example.com"
IPADDR=192.168.0.254
MTU=1500
NETMASK=255.255.255.0
NM_CONTROLLED=yes
ONBOOT=yes
BRIDGE=br0
TYPE=Ethernet
HWADDR=08:00:27:04:C7:4B
IPV6INIT=no
USERCTL=no

/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no

/etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you‘re having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
Bringing up interface eth1: Device eth0 does not seem to be present, delaying initialization.
As below,
技术分享
Delete the file /etc/udev/rules.d/70-persistent-net.rules, by commands:
mv 70-persistent-net.rules 70-persistent-net.rules.bak
reboot

encountered below problems,
技术分享
change the MAC_address in the ethernet configuration file as required, by commands,
ifconfig -a                                    #this is to get the MAC address of the etho0
vim /etc/sysconfig/network-scripts/ifcfg-eth0   #modify the MAC address in the configuration file

service network restart
For Linux-Instructors network configuration, I configured all and I am not sure which file makes it work.
Network configuration on Linux-Student, as below,
[[email protected] Desktop]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.0.101
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=192.168.0.254
TYPE=Ethernet
DNS1=192.168.0.254
IPV6INIT=no
USERCTL=no
PEERDNS=no

and by command
setup
In "Device configuration" -> "eth0 (eth0) - Intel Corporation 82540EM Gigabit Ethernet Controller"
技术分享
/etc/init.d/NetworkManager stop
chkconfig NetworkManager off
service network restart

3, testing the result from Linux-student and Linux-Instructor
the connection from Linux-student as Linux-student -> Linux-Instructor->Window Host-> Internet, testing ping 8.8.8.8, ping instructor.example.com, ping 192.168.0.254, all successful,
技术分享
the connection from Linux -Instructor as, Linux-student -> Linux-Instructor->Window host-> Internet, testing ping 8.8.8.8, ping 192.168.0.101, all successful,
技术分享

4, installation of VirtualBox Additions( VBOXADDITIONS_4.3.12_93733 ), and configure the share the folder between the Windows and Linux
Please refer to this link, http://xionghuilin.com/?p=7

5, reference links,
https://www.centos.org/forums/viewtopic.php?t=26971
https://www.centos.org/forums/viewtopic.php?t=7684


































































































































以上是关于VirtualBox network / study environment setup for RHEL的主要内容,如果未能解决你的问题,请参考以下文章

如何让 VirtualBox 4.3 允许来自 Vagrant 的内部专用网络

Windows7+VirtualBox+Ubuntu本地开发环境搭建

virtualbox操作技巧

使用virtualBox在CentOS6.5环境下以桥接方式配置网络

VirtualBox+ubuntu-16.04.2 下NAT+Host-only网络配置

virtualbox端口转发