Projecte

General

Perfil

Virtualbox » Historial » Versió 9

Pau Escrich, 05-01-2013 01:47

1 1 Pau Escrich
h1. Virtualbox
2
3
It is possible to emulate qMp with Virtual Box.
4
5 5 Pau Escrich
First of all open your virtualbox (VB) and create a new machine (type linux 2.6).
6 6 Pau Escrich
If you are using the VB wizard, do not select any storage device, we will do it latter.
7 5 Pau Escrich
8 3 Pau Escrich
h3. Storage
9 1 Pau Escrich
10 6 Pau Escrich
To make the things easy it is better to use IDE instead of SATA. So create a new IDE disk and browse between your folders
11
and select the qMp vdi image file.
12 3 Pau Escrich
13 2 Pau Escrich
h3. Network Configuration
14 1 Pau Escrich
15
First of all we create a virtual tun/tap device in the host machine.
16 3 Pau Escrich
17 8 Pau Escrich
<pre>ip tuntap add mode tap dev vbox 
18 1 Pau Escrich
ip link set vbox up
19
ip addr add 172.30.22.10/24 dev vbox
20 3 Pau Escrich
</pre>
21 1 Pau Escrich
22 3 Pau Escrich
In VB machine configuration at least one network interface must be added.
23 1 Pau Escrich
It should be configured as bridged interface to our new "vbox" network device.
24
The driver "PCnet-PCI II" works fine.
25
26
27
h3. Serial
28 3 Pau Escrich
29
A serial port is needed because OpenWRT expects it. So it should be added in the VB machine configuration.
30
31
It is possible to use it to connect with the qMp node from the host machine (useful for debug), but it is NOT NEEDED.
32
To do so you should configure the VB serial as host pipe.
33 1 Pau Escrich
Check the option "create pipe" and add the path "/tmp/vboxS0".
34 3 Pau Escrich
Then in the host machine execute:
35 8 Pau Escrich
<pre>socat UNIX-CONNECT:/tmp/vboxS0 TCP-LISTEN:7777 &
36 3 Pau Escrich
netcat localhost 7777
37
</pre>
38
39
And you will get serial!
40 9 Pau Escrich
41
h3. Start VM
42
43
At this point you can start your virtual machine with qMp, open a browser and go to http://172.30.22.1
44
45
If after the first reboot (automatic reboot) it does not boot (stays in "GRUB LOADING") reboot manually the VM.
46
47
h3. Clone
48
49
Ok, but just one node is quite boring so let's go to create more of them. Just switch-off the virtual machine, right click and Clone it.
50
Select the option "regenerate MAC addresses", boot the new  machine and then execute:
51
52
<pre>rm /qmp_configured
53
/etc/init.d/qmp_autoconf start
54
</pre>
55
56
Then both nodes should see each other!