OpenWrt Forum Archive

Topic: Running openWRT i386 compilation inside VMware?

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want to add a package to openWRT - namely: something like ser2net.
It seems to me that it may be easier to test a build release if one were able to run it as a i386 build inside a VM player.
I love how easy it was to use Ubuntu inside VMplayer to setup a development system of openWRT right there on my windows desktop. And adding kamikaze was nice and easy as well.

I am thinking that one could benefit from testing within a i386 VM player environment. Unfortunately I do not have a workstation version of VM player, I only have the Free Player edition, and thus can not setup en new environment, I can only run an excisting environment.

Anyone that would be able to setup a test environment of i386 of openWRT on a VM workstation?
I suppose that I would then be able to load my own compilations as a firmware upgrade.

Also I should note that I DO have a soekris net4801, a WRT54Gv2 and a FON box (2100) sitting on my desk, so further testing on real hardware is possible, I just really want a test environment where I am not as likelly to brick something running the first tests.

Any help or good ideas will be appreciated.

Load Linux on the host, and put VMware Server (it's free also) on top of it, then you can build your own VMs.

Hey that sounds great! Thanks for the tip. I'll find a way to set that up.

(Last edited by MrAlvin on 6 Jan 2007, 16:36)

vmware server can work on a windows host too, but vmware really works better on a linux host IMO

So far I only have access to a Win2003 Server, so I have now installed VMplayer Server edition on the windows server.

Next challenge will be to load one of the files from the "bin" folder into the VMplayer.
So far I have the following files in the "bin" folder:

ubuntu@ubuntu:~/kamikaze/bin$  ls -s
total 65156
16404 openwrt-x86-2.6-ext2.fs
20960 openwrt-x86-2.6-ext2.image
 4548 openwrt-x86-2.6-ext2.image.kernel
 1032 openwrt-x86-2.6-jffs2-128k.fs
 5584 openwrt-x86-2.6-jffs2-128k.image
 4548 openwrt-x86-2.6-jffs2-128k.image.kernel
 1032 openwrt-x86-2.6-jffs2-64k.fs
 5584 openwrt-x86-2.6-jffs2-64k.image
 4548 openwrt-x86-2.6-jffs2-64k.image.kernel
  908 openwrt-x86-2.6-vmlinuz
    8 packages

From the size of the files I suppode that it is either the "openwrt-x86-2.6-jffs2-128k.image" or the "openwrt-x86-2.6-jffs2-64k.image" file that I will need to get loaded inside VMplayer.

On other operating systems I would just make a cd and run the install program, but loading openWRT on a "virgin" router system would normaly be done using the JTAG port. I would be greatly surprised if such port  exists on the VMplayer.

So I suppose that some kind of file system must be established inside the VMplayer, and then a bootloader established, and then the i386 image of can be made to load.

While I research how to load the image file, any and all advice on the subject will be greatly appreciated.

[edit]
Okay, I found this web page http://www.graynetwork.org/ddwrtx86/ for the DD-WRT image, and I am hopeing that something like it will also apply to getting openWRT to run under VMware Player.
[/edit]

(Last edited by MrAlvin on 13 Jan 2007, 16:20)

Hi,

I had exactly the same idea of running OpenWRT within a VMWare. Did you already succeed? Please keep us up to date!

Regards

Kai Koehne

I get it working until 'Uncompressing Linux... Ok, booting the kernel.' That's it. If it's working maybe the devs integrate it into the buildsystem to automatically generate a vmdk image.

I just converted openwrt-x86-2.6-ext2.image to openwrt-x86-2.6-ext2.vmdk with qemu-img:

qemu-img convert -f raw openwrt-x86-2.6-ext2.image -O vmdk openwrt-x86-2.6-ext2.vmdk

Output running in VMware Player (then it hangs):

GRUB loading stage1.5.


GRUB loading, please wait...
Uncompressing Linux... Ok, booting the kernel.

Maybe this helps someone else to fix the rest.

EDIT: Hmm, probably it's booting fine but the output is redirected to the serial console...

(Last edited by forum2006 on 29 Jan 2007, 13:07)

YAY. Works fine smile

    GNU GRUB  version 0.97  (638K lower / 260032K upper memory)

 +-------------------------------------------------------------------------+
 | OpenWrt                                                                 |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 +-------------------------------------------------------------------------+
    Use the ^ and v keys to select which entry is highlighted.
    Press enter to boot the selected OS, 'e' to edit the
    commands before booting, or 'c' for a command-line.


    The highlighted entry will be booted automatically in 1 seconds.
  Booting 'OpenWrt'

root    (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
kernel  /boot/vmlinuz root=/dev/hda2 rootfstype=ext2 "" noinitrd console=ttyS0,
38400n8 reboot=bios
   [Linux-bzImage, setup=0x1200, size=0xdefe3]
boot
Linux version 2.6.19.2 (ubuntu@ubuntu) (gcc version 4.1.1) #1 Sun Jan 28 10:18:10 CET 2007
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
 BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000000fef0000 (usable)
 BIOS-e820: 000000000fef0000 - 000000000feff000 (ACPI data)
 BIOS-e820: 000000000feff000 - 000000000ff00000 (ACPI NVS)
 BIOS-e820: 000000000ff00000 - 0000000010000000 (usable)
 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved)
256MB LOWMEM available.
Zone PFN ranges:
  DMA             0 ->     4096
  Normal       4096 ->    65536
early_node_map[1] active PFN ranges
    0:        0 ->    65536
DMI present.
Allocating PCI resources starting at 20000000 (gap: 10000000:eec00000)
Detected 1919.916 MHz processor.
Built 1 zonelists.  Total pages: 65024
Kernel command line: root=/dev/hda2 rootfstype=ext2 "" noinitrd console=ttyS0,38400n8 reboot=bios
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 1024 (order: 10, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 257404k/262144k available (1335k kernel code, 4172k reserved, 324k data, 128k init, 0k highmem)
virtual kernel memory layout:
    fixmap  : 0xffffc000 - 0xfffff000   (  12 kB)
    vmalloc : 0xd0800000 - 0xffffa000   ( 759 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
      .init : 0xc02a2000 - 0xc02c2000   ( 128 kB)
      .data : 0xc024ddc4 - 0xc029edc8   ( 324 kB)
      .text : 0xc0100000 - 0xc024ddc4   (1335 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 3852.98 BogoMIPS (lpj=19264930)
Mount-cache hash table entries: 512
CPU: CLK_CTL MSR was 0. Reprogramming to 20000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
Compat vDSO mapped to ffffe000.
CPU: AMD Athlon(tm) XP 2600+ stepping 00
Checking 'hlt' instruction... OK.
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfd9a0, last bus=1
PCI: Using configuration type 1
Setting up standard PCI resources
Linux Plug and Play Support v0.97 (c) Adam Belay
PCI: Probing PCI hardware
PCI quirk: region 1000-103f claimed by PIIX4 ACPI
PCI quirk: region 1040-104f claimed by PIIX4 SMB
PCI: Using IRQ router PIIX/ICH [8086/7110] at 0000:00:07.0
PCI: Bridge: 0000:00:01.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 8192 bind 4096)
TCP reno registered
scx200: NatSemi SCx200 Driver
squashfs: version 3.0 (2006/03/15) Phillip Lougher
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
Limiting direct PCI/PCI transfers.
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Real Time Clock Driver v1.12ac
Non-volatile memory driver v1.2
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
hda: VMware Virtual IDE Hard Drive, ATA DISK drive
hdc: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
hdd: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 128KiB
hda: 41903 sectors (21 MB) w/32KiB Cache, CHS=41/16/63
 /dev/ide/host0/bus0/target0/lun0: p1 p2
 hda: p2 exceeds device capacity
block2mtd: version $Revision: 1.30 $
ip_conntrack version 2.4 (2048 buckets, 16384 max) - 240 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP vegas registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Using IPI Shortcut mode
Time: tsc clocksource has been installed.
VFS: Mounted root (ext2 filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 128k freed
init started:  BusyBox v1.4.0 (2007-01-28 05:03:37 CET) multi-call binary

Please press Enter to activate this console. EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
natsemi dp8381x driver, version 2.1, Sept 11, 2006
  originally by Donald Becker <becker@scyld.com>
  http://www.scyld.com/network/natsemi.html
  2.4.x kernel port by Jeff Garzik, Tjeerd Mulder
PPP generic driver version 2.4.2



BusyBox v1.4.0 (2007-01-28 05:03:37 CET) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r6224) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 10
model name      : AMD Athlon(tm) XP 2600+
stepping        : 0
cpu MHz         : 1919.916
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts
bogomips        : 3852.98

root@OpenWrt:/# free
              total         used         free       shared      buffers
  Mem:       257648         4336       253312            0          108
 Swap:            0            0            0
Total:       257648         4336       253312
root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                15.8M      2.5M     12.5M  17% /
root@OpenWrt:/# cat /proc/version
Linux version 2.6.19.2 (ubuntu@ubuntu) (gcc version 4.1.1) #1 Sun Jan 28 10:18:10 CET 2007
root@OpenWrt:/# lsmod
Module                  Size  Used by    Not tainted
ip_conntrack_tftp       1432  0
ip_nat_irc               704  0
ip_conntrack_irc        2480  1 ip_nat_irc
ip_nat_ftp              1280  0
ip_conntrack_ftp        3088  1 ip_nat_ftp
ppp_async               4672  0
ppp_generic            14964  1 ppp_async
slhc                    3616  1 ppp_generic
crc_ccitt                960  1 ppp_async
natsemi                15488  0
root@OpenWrt:/# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/#

Now play a bit with the serial console (named pipe), package a different NIC driver (I think ne2kpci would do the job) and write up a howto for it.

You can connect to VMware Players virtual serial console via \\.\pipe\com_1 at 38400n81 using PuTTY. You have to modify the VMX configuration file manually. See the links below.

For the VMX file:

# First serial port, physical COM1 is available
serial0.present = "TRUE"
serial0.fileType = "pipe"
serial0.fileName = "\\.\pipe\com_1"
serial0.tryNoRxLoss = "TRUE"
serial0.pipe.endPoint = "server"

Interesting links for VMware
- http://sanbarrow.com/vmx-serial-ports.html
- http://www.virtualization.info/2006/03/ … le-on.html
- http://www.easyvmx.com/
- http://www.vmware.com/download/player/

Soon, maybe at the end of the week I can provide a OpenWrt Kamikaze testimage with webif^2 for VMware Player.

(Last edited by forum2006 on 29 Jan 2007, 15:23)

Opened ticket #1317 in the ticket system which adds the possibility to create VMware images out of the buildroot.

Is there a working VMWare Image out there?
Maybe with the newest sources?

I would be very happy if someone shares his Image with me.

The onces I found aren`t working when just adding to VMWare,...
Maybe if you know how to modify the stuff it can work - but I am searching for an Image I just have to add to my VMWare and can start it without troubless smile

Greet`s Erich

does anyone have any working image for VMware ?
when I create an image with qemu its size is 6MB on VMware and thus I am unable to do anything.

sorcerer wrote:

does anyone have any working image for VMware ?

Compile your own...

The discussion might have continued from here.