uml: update README to usable examples
[openwrt/openwrt.git] / target / linux / uml / README.md
1 # OpenWrt inside a user mode linux
2
3 > Why would we even want this many ask?
4
5 There are potentially a lot of reasons, one obvious one to me, it allows folks
6 to 'kick the tires' without actually flashing up any hardware. It's also a
7 great environment for porting over packages, you can get a package fully
8 functional in the uclibc root environment inside a uml without actually
9 disturbing your 'real router', and then rebuild for a specific target once it's
10 fully tested.
11
12 This is a first stab at a build that 'just works' and there will be more
13 cleanup to come. The simple directions are:-
14
15 * Configure for uml target
16 * Configure with an ext4 or squashfs root file system
17 * Build it all
18
19 In your bin directory you will find a Kernel and an root file system when it's
20 finished. Just run it like this:-
21
22 ```shell
23 ./openwrt-uml-vmlinux ubd0=openwrt-uml-squashfs.img
24 ```
25
26 The uml will start and eventually the serial console of the uml will be at your
27 console prompt. If you would like it in xterms, substitute `con=xterm` and
28 `con0=xterm`. **No networking is configured** but it's a starting point. The
29 resulting file system has just enough free space to start kicking the tires and
30 playing in the world of 'embedded routers' along with all the resource
31 restrictions that come with that world.
32
33 To configure networking and more refer to the *user mode linux* documentation
34 online. A quick start goes along this line. Install the `uml-utilities`
35 packages so you have the `uml_switch` in and running, then add a command param
36 to your uml start like this:
37
38 ```shell
39 eth0=daemon,00:01:01:01:01:01,unix,/<your uml switch control socket here>
40 ```
41
42 With that in, and uml networking actually functional (can be a challenge at
43 times), you should be able to `ifconfig` the interface and talk to the host
44 side or if you bridged the uml switch to your host network, you should be able
45 to run `udhcp` and be away with networking off to the world. Again, if you are
46 unfamiliar with uml and uml networking, please read the docs and how-to stuff
47 available on the net. It does take some fiddling to get it started and working
48 right the first time, but after that, it opens up a whole new world of virtual
49 machines.
50
51 http://user-mode-linux.sourceforge.net/