Emulating software is a very grey area for Cisco, they make their money by selling boxes so I guess officially Cisco don’t approve of things like GNS3 and PEMU. BUT cisco make a lot of their money from techies training in Cisco products who then get their management to buy boxes their certified in, as a result cisco appear to turn a blind eye to emulating their products for personal training purposes
So, I’m installing a CS-Mars box in the next couple of weeks and wanted to know what’s new in version 6. How to setup version 4 is already document here in this franken cs-mars guide, the thing is to upgrade from 4 to 6 is a re-image of the box. Upon re-imaging my VMWare appliance I realised that the lilo commands linux rw init=/bin/bash didn’t appear to work anymore. As a result I have a v6 mars box I can’t use due to a licensing problem.
To get this working read through both the old instructions, and what I have written.
The init/boot sequence of a mars box looks very much like a centos/fedora boot, so I thought up a cunning new plan. I downloaded the 1st installation CD of centos 5, after booting this CD instead of hitting “enter” and running the anaconda installer I typed linux rescue, this boots my appliance into a root linux shell. (See Update Below, boot from CentOS straight after MARS installs, don’t let MARS boot!)
What happened next was a little hit and miss, if you’re lucky you can type
mkdir /mnt/opt mount /dev/md2 /mnt/opt
you can then
cd /mnt/opt/janus/release/bin mv pnlicense pnlicense.org echo "/bin/echo d84f7ceaf50f9c45683e2efb77752d4f:License verified:4:0:0:4" > pnlicense chmod +x pnlicense
as per the old documentation.
If you’re unlucky this “mount” will fail, in this case ls /mnt/sysimage if you can’t see any files issue mount /dev/md1 /mnt/sysimage otherwise the plan is to change the root password so that we can edit the pnlicense file later.
Using vi edit /mnt/sysimage/etc/passwd, and change…
pnadmin:x:500:500::/opt/janus/release/bin:/opt/janus/release/bin/pnsh
for
pnadmin:x:500:500::/opt/janus/release/bin:/bin/bash
Next, setup your editor variable, and edit the suders file…
EDITOR=/mnt/sysimage/bin/vi;export EDITOR visudo -f /mnt/sysimage/etc/suders
and add..
pnadmin ALL=(ALL) NOPASSWD: ALL
Reboot by exiting the shell.
After the reboot login as pnadmin, you should now get a standard linux bash shell rather than the “hardened” cisco one. Change the root password…
sudo su passwd root
And put /etc/password back to how it was. Now from the “pn shell” you can type expert and your root password will work and you’ll have root access to your mars box. With you new root access you can change the pnlicense file as described before and complete the setup process.
UPDATE: As commented by secopt below, to make this work you need to boot from the CentOS disk straight after the MARS image as installed, if you let the MARS OS boot (and start doing the oracle thing) then for some reason the mount commands don’t work!
UPDATE2: The mount command doesn’t work if you let MARS boot the 1st time as it changes the superblock, rokov has posted the following work around below…
- Assemble RAID
mdadm –assemble /dev/md0 /dev/hda3 /dev/hdc3- Change ext3 superblock magick number
dd if=/dev/md0 skip=2 count=1 | sed ’s/\x5A\x7B/\x53\xEF/’ | dd of=/dev/md0 seek=2 count=1- Mount partition
mount /dev/md0 /mnt- Do anything you want with it.
- Unmount partition and change magic back
umount /mnt && d if=/dev/md0 skip=2 count=1 | sed ’s/\x53\xEF/\x5A\x7B/’ | dd of=/dev/md0 seek=2 count=1
Hi. i have problem with you instruction on VMWARE MARS
i reimage my Mars 4.6 to 6.0 (recovery DVD 6.0.1 1 hard IDE), download centos first cd. when boot from cdrom i type: linux rescue. i select check my hard for mount sysimage, but centos don’t search any partion from my hard. i exit to shell, and type /dev/md1 /mnt/sysimage and see not found file or directory.
also i type
mkdir /mnt/opt
mount /dev/md2 /mnt/opt
directory create, but mount is not seccesufull. Unknown file or Directory.
What is it?
If i boot from hard drive, i can open https but i see license (
Also, i recovery 6.0.1 from new wmvare machine with 2 hard (soft raid) but problem repeat.
Maybe i incorrect install?
Exactly the same problem as L0gRuS. Instruction doesn’t work.
shame
When booting the CentOS disk on my PC, either /mnt/sysimage is already mounted, and I can update suders, or I can mount /mnt/opt… never both, I will see if I can work out what I’m doing different to you guys.
Hi
Has anyone had any progress, I cant make it work either?
//Stewen
Hi,
I used the old setup instructions for version 6 using vmware version 6. I set it up with a single 120 gb IDE drive on 0:0 and CDROM at 0:1. I added the extra lines to the config for the two NICS and after a long oracle install i was able to log in. The two nics for some reason were already assigned IP’s so I didnt have to use the ifconfig command. I was able to change the pnadmin password and actually log into the system from a browswer, but I get the license request page. Thats all good!
Here is my problems though:
As stated above, the LILO commands to get you into single user mode no longer work.
I downloaded the first CENTOS ISO and told the MARS install to boot off of that but it just goes straight into the MARS install. I went into the BIOS of the virtual machine and its not letting me boot off of CD anymore, only HARD DRIVE and removeable media. And it actually wont let me add the ability to boot of of CD, which prevents me from booting off of one of the CENT OS ISO’s.
Any ideas? Am I missing something simple?
Thanks
I also had the same, this does not work, someone emailed a procedure by which to edit the vm files direct, but I lost my email and now cant find it!
@Wildfire, that’s a good idea – Did you mean http://www.vmware.com/download/eula/diskmount_ws_v55.html ??
I’ve posted a gallery of CentOS mounting the Mars partitions for all the non-believers out there
This worked for me but the CENTOS boot didnt. So i downloaded the NAC Appliance ISO and booted off of it and did the easy mount commands and have the MARS up and running as a MARS 50 with no license restriction. The only issue is the speed for boot times, the ORACLE loading time is very long and any reboots such as after changing IP’s takes a long long time. Has anyone had success with speeding up the process? Is the boot time due to the writing and reading of the VM drives?
thanks
@sporty64
I’ve noticed that the 1st boot (loading ORACLE) of an actual Cisco appliance takes ages, but gets quicker on subsequent boots.
Thanks, it seems the pnuserV i believe is the next process load and takes a long while as well. I’ll compare it to our live box for boot times. I wonder if adding multiple processors to the VM might help or dedicating a physical machine to it might be better.
thanks for the response
Hi everyone!
Thanks for all advices! I’m not that good at linux, but realy want to make this work because I need to learn the new version. I downloaded nac-4.5_0-K9.iso and booted on it. But I only have 2 option Server or Manager install. How do I get the prompt?
What commands or boot commands should i use?
Tanks in advance!
//Stewen
The Centos boot disk option worked for me after many attempts. The important thing is to boot from the centos disk immediately after the mars 6 build. Disk is automatically mounted under /mnt/sysimage. I used CentOS-5.2-i386-bin-1of6.iso and csmars-6.0.1.3066.iso. The MAC boot also works but has to be less than version 4 or you do not get recovery options.
Thanks Secopt!!!
I hadn’t thought that people would boot MARS and then reboot into CentOS… I’m way to impatient! I’ve added an update stressing not to let MARS boot, and that you should boot into CentOS’s rescue mode straight after the MARS install has finished.
Excellent post!! I could not mount the partition’s as demonstrated above when booting off the CentOS 5 disc (got ‘no such file or directory’ errors). I booted CentOS again and let the rescue procedure mount the raid for me (/dev/md? stuff). The installer asked if it should try to locate the system and mount them? I said ‘yes and’ then proceeded to the shell. All partitions were mounted under /mnt/sysimage/ Everything else was bang on. Thanks again!
North , can you post exactly what you did ?
thanks
Well, I booted with a CentOS right after MARS was installed but It went straight through to MARS. Does anyone have more ideas or know how to fix this issue ?
Sounds like you haven’t changed the boot order of the fake-vmware-bios.
When you power on a VM, at the logo stage, black screen showing vmware for about 3 seconds, hit “escape” and select boot from CD-ROM.
hth,
Nick
thanks Nick, the trick was hitting ESC once . Now I’m in the same problem described above
can’t mount /dev/md2 , because it doesn’t recognize it as a directory
what is /dev/md2 ?
/dev/md2 is a metadevice representing the raid drives.
I figured out the solution to the “no file or directory exists” thing…at the centOS terminal, type in “raidstart /dev/md2″ and then you should be able to mount it. This starts the software raid as it reads it. I was able to get in once I did that before I “mount /dev/md2 /mnt/opt”. (I haven’t tested if this works after the first setup or the license portion of the guide works but if I don’t post back, assume it did.
OK, so i followed yhe instructions but when I boot up the MARS after all the mumbo jumbo it won’t accept “pnadmin” – “pnadmin” to login, is there something I have missed or what?
never mid turned out the “suders” statement was wrong.. works great now thx!
Well, just checking in with a “It’s Alllliiiiiive!”….my franken mars is up and running on 6.0.3 (latest as of this posting). The guide worked flawlessly (with the exception of needing to add a “raidstart /dev/md2″ before mounting in the CentOS rescue portion of the document). The license hack still works and I have a fully functioning MARS with two 200GB hard drives (I didn’t have 120′s lying around
).
That’s great news, thanks for the raidstart tip Sean
Intresting I couldnt get 6.0.3 working, Sean did you follow the proceduce above to get this working?
I managed to load up 6.0.1, but cant upgrade. Upgrading to 6.0.2 kills the licencing, and centos says it cannot see any linux partitions, even if I boot into Centos on the first reboot at the end of the upgrade
trying to re-image with the 6.0.3 ISO doesnt work, it says “cannot partition disk (hda)”
happy to run 6.0.1 as its only for training purposes, just advising of my experience
Yes. works only 6.01. when i tryed install 6.0.3 i freeze on install oracle database. but 6.0.1 is work normally
\
When booting the CentOS disk on my PC, either /mnt/sysimage is already mounted, and I can update suders, or I can mount /mnt/opt… never both, I will see if I can work out what I’m doing different to you guys.
Hi logib2005, you only really need to be able to do one
If you can update sudoers then once MARS boots use your root access to edit the license file.
If you can mount /mnt/opt then update the license file and don’t stress too much about root access.
Hi All!
I’ve found out why MARS partitions cannot be mounted.
The reason for this is that ext3 superblock magick number is changed on MARS partitions from 0x53ef to 0x5a7b. So in order to mount these partitions we need to change magic number to correct one.
Here are step-by-step instructions:
1. Assemble RAID
mdadm –assemble /dev/md0 /dev/hda3 /dev/hdc3
2. Change ext3 superblock magick number
dd if=/dev/md0 skip=2 count=1 | sed ‘s/\x5A\x7B/\x53\xEF/’ | dd of=/dev/md0 seek=2 count=1
3. Mount partition
mount /dev/md0 /mnt
4. Do anything you want with it.
5. Unmount partition and change magic back
umount /mnt && d if=/dev/md0 skip=2 count=1 | sed ‘s/\x53\xEF/\x5A\x7B/’ | dd of=/dev/md0 seek=2 count=1
GUYS!!!… After 3 days of hard work I finally got everything working. I didn’t have to ask any questions. It’s all right here and all I had to do was pay attention to the DETAILS!!
I’m running CS-MARS 6.0.5 (3358). The license “work-around” worked very well.
Thanks so much.
Hi All.
Many thanks to all of you in helping me reset the root password on my MARS-100E running v6.0.5 software. I’d like to share that I successfully adapted rokov’s advice to mount v6.0.5 partitions after booting with CentOS disk 1. On this model the system image in on sda3, you just replace md0 with sda3 in rokov’s steps. You skip step 1 as this box does hardware RAID which CentOS recognizes. Once mounted it’s a breeze to monkey around with the license and password files as per the franken-MARS instructions.
BTW I discovered that the v6.0.5 recovery disk will install as a MARS-200 on the MARS-100E hardware if you use the 3ware BIOS RAID utility to change the 6 250GB disks to RAID 5 (1.2TB usable space) from RAID 10 (750GB usable space). I’m sure this kind of ‘upgrade’ has its drawbacks but maybe knowing about this curiosity will be helpful to some.
Cheers!
i have a problem i install the mars 6.0.4 and when i try boot with centos linux rescue at the end say that i no have linux partitions, but the mars work fine
lokito, you can’t let MARS boot for the centos trick to work as the 1st time it does the superblock magic number is change on the raid partition.
Either use rokov solution posted above, or straight after the MARS installation process boot centos.
Cheers,
Nick
hi, happy new year.
i install and all good, but i have a problem.
i try access via web https://X.X.X.X:8443/
and say server no respond.
if from the same remote machine try access via ssh i get access but via web no.
any have a anwser?
thks
OK, for those of us “Windows” guys that don’t know Linux that well, there is a bit of a learning curve to the whole partition and mounting thing. I appreciate all that has been shared here, but am having nothing but problems with “invalid arguments”, “command not found”, and a bunch of other stuff. When using RAID, I can never do anything with md0, md1, md2, etc. I can fdisk -l the device names and see the partitions that way, but I can never get the commands to work right. I’ve tried a single vmdisk with similar issues realizing that the device references are a bit different. When using rokov’s notes and try to use the mdadm -assemble command, I get “mdadm: option -s not valid in manage mode”, which doesn’t even give me anything on Google. I had this working a while back on 4.x, but can’t get the 6.0.5 to work. Like I said, I appreciate everyone’s input here, but how hard is it for you to put all of these notes and updates into a single “start-to-finish” document of how to accomplish this. And, I’m assuming you are all using 2 VM disks to do this?
THE ENTIRE SECTION ABOUT EDITING THE PASSWD FILE AND CREATING A SUDERS CAN BE REPLACED WITH:
chroot /mnt/sysimage
passwd root
This can be run right after the license hack.
TA DA!!!