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