VirtualBox for your first FAI installation: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 34: Line 34:
= FAI install server with fixed IP (private network) =
= FAI install server with fixed IP (private network) =


Not yet done
* create a softweare bridge in a private network on you host machine.
 
----
# fai-mk-network username
----
 
You will see nine tap devices and a bridge which has the IP 192.168.33.1.
 
----
myhost[~]# ip ad
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8995 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 12:23:34:45:53:33:a2 brd ff:ff:ff:ff:ff:ff
    inet 111.222.33.44/25 brd 111.222.33.255 scope global eth0
        valid_lft forever preferred_lft forever
3: tap1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f6:51:60:4f:2c:eb brd ff:ff:ff:ff:ff:ff
4: tap2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:f3:1b:03:43:e0 brd ff:ff:ff:ff:ff:ff
5: tap3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f6:7f:7c:15:ad:cd brd ff:ff:ff:ff:ff:ff
6: tap4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:a5:7d:25:43:93 brd ff:ff:ff:ff:ff:ff
7: tap5: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:f7:c1:06:43:b9 brd ff:ff:ff:ff:ff:ff
8: tap6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:26:4f:10:27:fb brd ff:ff:ff:ff:ff:ff
9: tap7: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:40:98:4b:df:24 brd ff:ff:ff:ff:ff:ff
10: tap8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:22:72:0b:0c:21 brd ff:ff:ff:ff:ff:ff
11: tap9: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:35:50:53:79:84 brd ff:ff:ff:ff:ff:ff
12: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether f2:26:4f:10:27:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.33.1/24 brd 192.168.33.255 scope global br0
        valid_lft forever preferred_lft forever
----
 
----
myhost[~]# brctl show
bridge name    bridge id              STP enabled    interfaces
br0            8000.f2264f1027fb      no              tap1
                                                        tap2
                                                        tap3
                                                        tap4
                                                        tap5
                                                        tap6
                                                        tap7
                                                        tap8
                                                        tap9
----
 
 
On the host you see the network of the host system (here
111.222.33....) and our new private network 192.168.33.0/24.
----
myhost[~]# ip route
default via 111.222.33.254 dev eth0
111.222.33.128/25 dev eth0  proto kernel  scope link  src 111.222.33.136
192.168.33.0/24 dev br0  proto kernel  scope link  src 192.168.33.1
----
 
 
Now, create a Host-only network in VirtualBox. This will be done in
the main menu, not in the setting of a VM.
 
----
File -> Preferences -> Network -> Host-only Networks
----
Add a new network, this will become vboxnet0. Set the IP address to 192.168.33.251.
It's important to disable the DHCP Server in this network!
 
Then, for each VM choose the host-only Adapter vboxnet0 i the settings
of each VM.

Revision as of 13:52, 12 January 2017

Introduction

In the FAI guide one can find detailed instructions on how to use KVM, however it is quite possible to use any virtual machine, as in hypervisor, solution such as VirtualBox or VMWare.

The biggest obstacle is setting up the network between the host and various client machines correctly.

FAI install server as DHCP client

alt Network setting FAI server as DHCP client

For this setup to work, you obviously require your own DHCP server. In most home networks, that would usually be the router.

Simply create your virtual machine as usual, but instead of using a NAT for networking, select bridged adapter.









Client

For the clients, use the same network settings as for the FAI server.

FAI install server with fixed IP (private network)

  • create a softweare bridge in a private network on you host machine.

# fai-mk-network username

You will see nine tap devices and a bridge which has the IP 192.168.33.1.


myhost[~]# ip ad
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8995 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 12:23:34:45:53:33:a2 brd ff:ff:ff:ff:ff:ff
    inet 111.222.33.44/25 brd 111.222.33.255 scope global eth0
       valid_lft forever preferred_lft forever
3: tap1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f6:51:60:4f:2c:eb brd ff:ff:ff:ff:ff:ff
4: tap2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:f3:1b:03:43:e0 brd ff:ff:ff:ff:ff:ff
5: tap3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f6:7f:7c:15:ad:cd brd ff:ff:ff:ff:ff:ff
6: tap4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:a5:7d:25:43:93 brd ff:ff:ff:ff:ff:ff
7: tap5: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:f7:c1:06:43:b9 brd ff:ff:ff:ff:ff:ff
8: tap6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether f2:26:4f:10:27:fb brd ff:ff:ff:ff:ff:ff
9: tap7: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:40:98:4b:df:24 brd ff:ff:ff:ff:ff:ff
10: tap8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:22:72:0b:0c:21 brd ff:ff:ff:ff:ff:ff
11: tap9: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 500
    link/ether fe:35:50:53:79:84 brd ff:ff:ff:ff:ff:ff
12: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether f2:26:4f:10:27:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.33.1/24 brd 192.168.33.255 scope global br0
       valid_lft forever preferred_lft forever


myhost[~]# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.f2264f1027fb       no              tap1
                                                        tap2
                                                        tap3
                                                        tap4
                                                        tap5
                                                        tap6
                                                        tap7
                                                        tap8
                                                        tap9


On the host you see the network of the host system (here 111.222.33....) and our new private network 192.168.33.0/24.


myhost[~]# ip route
default via 111.222.33.254 dev eth0
111.222.33.128/25 dev eth0  proto kernel  scope link  src 111.222.33.136
192.168.33.0/24 dev br0  proto kernel  scope link  src 192.168.33.1


Now, create a Host-only network in VirtualBox. This will be done in the main menu, not in the setting of a VM.


File -> Preferences -> Network -> Host-only Networks


Add a new network, this will become vboxnet0. Set the IP address to 192.168.33.251. It's important to disable the DHCP Server in this network!

Then, for each VM choose the host-only Adapter vboxnet0 i the settings of each VM.