OpenWrt Forum Archive

Topic: [howto] Running Kamikaze (x86-2.6) on VMware

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

Tex-Twil wrote:
sioux wrote:

hi all
is it possible to secure console with something more the just pressing enter to login?

What do you mean exactly ? I don't really understand. Don't forget that if you run openwrt on a ream hardware, there is no "screen". The only way to log in to it is ssh, telnet .. where you have a password.

Tex

I believe he means this:

If you start up the VM in VMware (or qemu or VirtualBox) there is no login prompt to control access to it.  This should not generally be a problem, of course, but asking how to add a login prompt is not an invalid question.

If you have OpenWrt on a physical device with an easily accessible serial port, someone could just come along with a laptop and a crossover serial cable and have complete access to the device.  Of course the serial interfaces of most of the devices that run OpenWrt are not accessible without at least a screwdriver.

Wodin wrote:

If you start up the VM in VMware (or qemu or VirtualBox) there is no login prompt to control access to it.  This should not generally be a problem, of course, but asking how to add a login prompt is not an invalid question.

If you have OpenWrt on a physical device with an easily accessible serial port, someone could just come along with a laptop and a crossover serial cable and have complete access to the device.  Of course the serial interfaces of most of the devices that run OpenWrt are not accessible without at least a screwdriver.

Ok I understand smile

"control access to it" should be "control access to the console."

Wodin wrote:
Tex-Twil wrote:
sioux wrote:

hi all
is it possible to secure console with something more the just pressing enter to login?

What do you mean exactly ? I don't really understand. Don't forget that if you run openwrt on a ream hardware, there is no "screen". The only way to log in to it is ssh, telnet .. where you have a password.

Tex

I believe he means this:

If you start up the VM in VMware (or qemu or VirtualBox) there is no login prompt to control access to it.  This should not generally be a problem, of course, but asking how to add a login prompt is not an invalid question.

If you have OpenWrt on a physical device with an easily accessible serial port, someone could just come along with a laptop and a crossover serial cable and have complete access to the device.  Of course the serial interfaces of most of the devices that run OpenWrt are not accessible without at least a screwdriver.

YES. exacly

i will try Wodin's sugestions
thx

it works!
after compiling with login and getty all i need to do is change one line in /etc/inittab

-tty1::askfirst:/bin/ash --login
+tty1::askfirst:/sbin/getty 38400 tty1 vt100

Does failsafe mode still work?

Wodin wrote:

Does failsafe mode still work?

how should failsafe mode work under x86?
all I see in vmware console

Warning: unable to open an initial console.

when I'm trying to connect to it via network it does'n respond (I try 192.168.1.1 and manualy set static address on lan interface)

(Last edited by sioux on 7 Mar 2008, 09:28)

Why would one need failsafe mode if you are running OpenWrt in a VM?

You have a virtual serial console and if you enabled you have VGA output. Makes no sense to me for the need to have failsafe mode in a VM...

(Last edited by forum2008 on 7 Mar 2008, 11:02)

forum2008 wrote:

Why would one need failsafe mode if you are running OpenWrt in a VM?

You have a virtual serial console and if you enabled you have VGA output. Makes no sense to me for the need to have failsafe mode in a VM...

Yes, you are right.  I forgot for a moment that we were talking about VMs smile  I was actually wondering if failsafe would still work if you did this on an actual router, although having an easily accessible serial port on a router is probably asking for trouble anyway.

Tex-Twil wrote:

Ok,
I have a vmware image with kamikaze and webif² on it. I actually followed the steps described on the wiki : http://wiki.openwrt.org/RunningKamikazeOnVMwareHowTo to build it. I used the provided VM config file.

Anyway, you can download it from here http://www.megaupload.com/?d=0AFC10MA
If it works fine, maybe someone could host it on a server instead of using the megaupload.

Btw, the password for root is toor

Tex

Hi,
I tried to compile the SVN version for a x86 VMware but when I try to boot the generated image in the vmware, after GRUB I have the error

Error 15: File not found

Did anybody tried the svn version in vmware ?

cheers,
tex.

(Last edited by Tex-Twil on 14 Mar 2008, 10:08)

i'm getting the same problem. anyone have insights into why this is happening?

Hi,
together with Limar from #IRC we found the problem and a "hack" solution. The symbolic link to the kernel seems to point to a wrong directory/ file:

 openwrt-x86-vmlinuz -> ../../x86/boot/bzImage

When grub tries to boot from the /boot partition, it can't  find the file. I booted with a liveCD on the VMware, mounted the /boot partition and put the correct kernel file.

/build_dir/linux-x86_generic/linux-2.6.24.2/arch/x86/boot/bzImage

For those who want to test the SVN version on vmware, here it is the version Bleeding Edge r10588:


edit: with webif²
http://www.megaupload.com/?d=U9VVL41E
log   : root
pass : toor

Tex

(Last edited by Tex-Twil on 14 Mar 2008, 16:20)

An addition to Tex-Twil's post:
The problem seems to be somewhere inside the build-system.

me@rechner:~> find kamikaze/ | grep bzImage
kamikaze/build_dir/linux-x86_mediacenter/linux-2.6.24.2/arch/x86/boot/.bzImage.cmd
kamikaze/build_dir/linux-x86_mediacenter/linux-2.6.24.2/arch/x86/boot/bzImage
kamikaze/build_dir/linux-x86_mediacenter/linux-2.6.24.2/arch/i386/boot/bzImage -> ../../x86/boot/bzImage 
kamikaze/build_dir/linux-x86_mediacenter/bzImage -> ../../x86/boot/bzImage

the last one of this list is pointing to the wrong directory -> after installing an image "/boot/vmlinuz" is an exact copy of "kamikaze/build_dir/linux-x86_mediacenter/bzImage" because the symlink could not be followed.

has anyone had success installing applications in the 7.09 vm?

root@openwrt:~# ipkg install /tmp/helloworld_1_mipsel.ipk

Clearing state_want and state_flag for pkg=helloworld (arch_priority=0
flag=16 want=2)
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package helloworld.
Check the spelling or perhaps run 'ipkg update'

(Last edited by yanokwa on 16 Mar 2008, 07:13)

I get a similar error trying to install the vpnc package from the "backports" packages.

I have tried downloading locally and it still does not work.

Anyone got this working?

yanokwa wrote:

has anyone had success installing applications in the 7.09 vm?

root@openwrt:~# ipkg install /tmp/helloworld_1_mipsel.ipk

Clearing state_want and state_flag for pkg=helloworld (arch_priority=0
flag=16 want=2)
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package helloworld.
Check the spelling or perhaps run 'ipkg update'

to answer my own question. seems the problem is that the vm is compiled as x86 and the binary was mipsel.

is there anyway the vm can emulate the mipsel architecture?

Or can I recompile vpnc for X86?

RamWreck

RamWreck wrote:

Or can I recompile vpnc for X86?
RamWreck

Hhmm, I compiled all the packages for x86 but I cant install vpnc. It says:

root@OpenWrt:~# ipkg list | grep vpnc
vpnc - 0.4.0-1 - VPN client for Cisco 3000

root@OpenWrt:~# ipkg install vpnc
Installing vpnc (0.4.0-1) to root...
Nothing to be done
An error ocurred, return value: -1.
Collected errors:
ERROR: Package vpnc (parent vpnc) is not available from any configured src.
Failed to download vpnc. Perhaps you need to run 'ipkg update'?

I don't really understand. Maybe someone could enlighten us ?

Tex.

(Last edited by Tex-Twil on 17 Mar 2008, 20:46)

Not sure what you're asking exactly.  qemu can emulate MIPS, but I don't know if one of the MIPS ports of OpenWrt runs on it.  I have heard of someone getting qemu to emulate an AR7 (as far as I remember).

I don't see why you couldn't compile vpnc for x86, although I haven't tried.

Wodin wrote:

Not sure what you're asking exactly.  qemu can emulate MIPS, but I don't know if one of the MIPS ports of OpenWrt runs on it.  I have heard of someone getting qemu to emulate an AR7 (as far as I remember).

I don't see why you couldn't compile vpnc for x86, although I haven't tried.

Wodin,

Can you point me in the direction of how I would go about recompiling vpnc?

Thanks in advance.

RamWreck

Maybe this helps.

Compiling and running OpenWrt trunk for VMware


Checkout trunk source code from subversion
cd ~
svn checkout https://svn.openwrt.org/openwrt/trunk/ ~/trunk/
cd ~/trunk/

Checkout the feeds with the extra packages
./scripts/feeds update

Only symlink the packages you like to compile
./scripts/feeds install <pkg_name_1> <pkg_name_2>

e.g.:
./scripts/feeds install nano wget webif vpnc
Collecting package info: done
Collecting target info: done
Installing package 'nano'
Installing package 'wget'
Installing package 'haserl'
Installing package 'webif'
Installing package 'libgpg-error'
Installing package 'libgcrypt'
Installing package 'vpnc'

Run menuconfig select features and packages
make menuconfig

First select
Target System: x86 [2.6]
Subtarget: Generic
Target Profile: Generic

Target Images
- jffs2: n
- Filesystem part size (in MB): 128

Utilities > editors
- nano: y
Network
- VPN > vpnc: y
- wget: y
Kernel modules > Network Devices
- kmod-e1000: y
- kmod-natsemi: n
- kmod-ne2k-pci: n
Kernel modules > Other modules
- kmod-input-core: y
Administration > webif
- webif: y
- webif-theme-xwrt-mini: y

Now start the build
make world

Finally convert the image to an VMware image using qemu-img
qemu-img convert -f raw bin/openwrt-x86-ext2.image -O vmdk bin/openwrt-x86-ext2.vmdk

(Last edited by forum2008 on 18 Mar 2008, 12:52)

Thanks for the detailed reply. I will give it a shot and let you know what happens.

RamWreck

(Last edited by RamWreck on 18 Mar 2008, 15:33)

forum2008 wrote:

Maybe this helps.

Compiling and running OpenWrt trunk for VMware


Checkout trunk source code from subversion
cd ~
svn checkout https://svn.openwrt.org/openwrt/trunk/ ~/trunk/
cd ~/trunk/

Checkout the feeds with the extra packages
./scripts/feeds update

Only symlink the packages you like to compile
./scripts/feeds install <pkg_name_1> <pkg_name_2>

e.g.:
./scripts/feeds install nano wget webif vpnc
Collecting package info: done
Collecting target info: done
Installing package 'nano'
Installing package 'wget'
Installing package 'haserl'
Installing package 'webif'
Installing package 'libgpg-error'
Installing package 'libgcrypt'
Installing package 'vpnc'

Run menuconfig select features and packages
make menuconfig

First select
Target System: x86 [2.6]
Subtarget: Generic
Target Profile: Generic

Target Images
- jffs2: n
- Filesystem part size (in MB): 128

Utilities > editors
- nano: y
Network
- VPN > vpnc: y
- wget: y
Kernel modules > Network Devices
- kmod-e1000: y
- kmod-natsemi: n
- kmod-ne2k-pci: n
Kernel modules > Other modules
- kmod-input-core: y
Administration > webif
- webif: y
- webif-theme-xwrt-mini: y

Now start the build
make world

Finally convert the image to an VMware image using qemu-img
qemu-img convert -f raw bin/openwrt-x86-ext2.image -O vmdk bin/openwrt-x86-ext2.vmdk

That worked very well. :-)

Thanks for taking the time to help out.

RamWreck

Tex-Twil wrote:

Anyway, you can download it from here http://www.megaupload.com/?d=0AFC10MA
If it works fine, maybe someone could host it on a server instead of using the megaupload.

Btw, the password for root is toor

Tex

Tex, that pass doesnt work in the ssh,.

what is the right one?

elect86 wrote:
Tex-Twil wrote:

Anyway, you can download it from here http://www.megaupload.com/?d=0AFC10MA
If it works fine, maybe someone could host it on a server instead of using the megaupload.

Btw, the password for root is toor

Tex

Tex, that pass doesnt work in the ssh,.

what is the right one?

Well I do believe so but it's not the case you can easily change it vie the vmware console

passwd

. After you boot, you should have a shell prompt;
Tex