Archive for November, 2010

Reset root password on VMWare ESX/ESXi v4

Tuesday, November 30th, 2010

It so happened that we received a server with ESX on it and some settings; like the IP address to connect to it. Which was wrong. Then the user/password to connect to it which, you guessed, was wrong as well.

So, here I was unable to use the machine because some folks could not remember what password they set on the machine. And then comes google-ing to figure out how to reset it. There’s the vmware KB article that explains it along with some others and all of them mention the grub loader screen. Well, bad luck because on our esxi version 4, there’s syslinux as bootloader. Of course I figured this out after installing knoppix on a usb drive and booting from it (because the server came with no cd/dvd drive). Then came the second issue, of mounting the filesystems as explained in most of the articles on the net about resetting the root password (because as explained, we couldn’t edit the bootloader config to enter single user mode). Well, the issue was that some of the partitions on the disk were vmfs which might be something vmware related, I haven’t digged to find out since the issue was present: I couldn’t mount and hence was unable to read/write to those partitions.

Then, I figured I could play around with the syslinux boot config file to try to force it to enter single user mode. And since there was the syslinux.cfg and a couple of boot.cfg on some other partitions, I modified them all. But to no avail, for some reason I couldn’t guess what the kernel was so the boot failed. Better said, and I quite: “Kernel panic”. I love that message 😀

Back to the issue at hand, finally :P, I noticed some tgz files out of which 2 had current date. I immediately thought that they might contain some stuff about current things (ambiguous, I know) so I jumped with MC (midgnight commander) in them. To my surprise, the state.tgz file contained a local.tgz which contained the /etc directory which contained, among other things, the shadow file. Someone screamed bingo? 🙂 I know I almost did.

So what I did was to extract everything out (since MC does not support saving changes into archives, or at least not with that knoppix version), edited the shadow file and removed the roots password hash (as explained in a lot of articles on the net) and then I tar-ed the /etc in local.tar, then I gzip-ed that into local.tgz then I tar-ed that into state.tar and then gzip-ed that into state.tgz, every time making sure to chmod 700 on the tgz files (as on the original file), and wrote that to the mounted partition overwriting the existing one. And voila, root password got reset.

Phew, that issue took a few hours to solve. Well, enjoy 😉

Related posts

Time flies, software changes… or not!

Friday, November 26th, 2010

I’ve been a long time user of Zone Alarm free firewall (and pro when there were free promotions).

However, during this time, every time I had internet issue,s ZA freezed my system (well, the applications that needed internet access verification, anyway). Why in the world does it have to timeout after a few minutes if there is no internet connection and why it doesn’t cache the information instead, is beyond me. I’ve even opened cases with their support on the issue but of course to no avail. So, just as with moving from opera to firefox, I switched from zonealarm to outpost firewall, but I disabled the firewall in outpost (something impossible to do in zonealarm) as I don’t really need the firewall part, only the application control, because I am behind a linux firewall and truth be told, nothing get’s passed that. And even if I wouldn’t be, I strongly recommend a hardware firewall instead of a software one, because the software one always needs updates and consumes a huge amount of system resources and let’s be honest: the firewall part is really no big deal and doesn’t really need updating. Iptables is “old”, in the sense that I use the exact same rules in it that I wrote over 5 years ago with minor additions/tweaks to support development in the system and the internal network and services provided.

And today my free AVG antivirus wants me to upgrade and their site mentions that software updates are not included in the free version. Well, boys and girls from AVG, I’ve been with you from a very long time and promoted you everywhere but now … I switched to avast. Just because they’re still free with updates. As I always say: Your AV is only good until it’s properly updated. Bye-bye.

Now, onto firefox. As some of you might remember and some don’t, I wrote a little while ago about how I ditched opera and moved to FF. However, that hasn’t become a much better experience as I initially hoped for and that’s because even though I now use “only” about 50 or so tabs open (compared to 120 in my tests) it still eats up almost 600 mb of memory (ram+disk). Not to mention that it takes a few minutes to close it down which obviously has a huge impact on the time needed to both close the PC and startup FF.

Now, there is something I really cannot understand. Why in the world are todays software such huge resource hogs? Really, if I install 5 such software they will all need a total of over 4 GB ram, including OS and that is about the average user programs somebody will have running at a given time. Are todays programmers really that stupid? Why the fuck (sorry) do I have to keep buying new hardware to meet the resource necessity of new software? Seriously, I only use a browser, email client, some IM programs and software development stuff. Not counting the last ones, all those are fairly the same in principle as 20 years ago, but their resource consumption is trough the roof. Where the hell is the progress if during these 20 years, I never ended up having a faster machine ? The OS should start in under 10 seconds, any application should fully load in less than 3 seconds. Everything should work like “snap”. And still, we’re not better at this than we were 20 years ago.

Where is the progress?

My needs haven’t changed in the past 20n years. I want to be able to communicate with somebody, (IM & email), and get some information off the internet (browser) all this in a simple OS that manages just that.

Instead, I get a load of crap. Over 80% of the services installed on my system are disabled, as I don’t use them. From whatever is left, I’d disable almost all if it weren’t for my system to become unstable as I don’t need them either. Of all the features the OS provides, I probably don’t need even 90% of it. And I’m thinking as a general user, begin somebody who installed PC’s for a lot of “average” people. Same thing goes for applications.

Current hardware is so fast, that the user cannot notice a significant difference between loading 20 MB of data off the hard drive or from RAM . And I’m not talking about raw data, which obviously is hundreds of times faster loaded from RAM than disk, but for the dump of a web browsers content in a tab. That is, a webpage. So why the fuck (sorry again) do you browser developers have to keep all that shit in memory instead of keeping it on disk. Do you really think that I give a fuck (sry) that when I switch tabs I have to wait about 1 second for it to load from disk? Seriously, 1-2 seconds are not even enough to notice that.

I’m thinking of re-writing firefox to behave like that. Too bad it’s in C++ and I’m a delphi/pascal punk.

I think for starters I’ll just create a new browser based on IE, although IE sucks; but I’ll just use that for rendering pages so that I can implement my theory and prove that it’s usable.

But since I’m scarce on time and hence don’t want to work in vain, anybody interested in this project? IE users will probably be 🙂

Related posts

[SOLVED] Diablo 2 CPU usage 50%/100%

Friday, November 12th, 2010

(for those who don’t like reading, solution is at the end of the article 🙂 )

I’m not going into the details but it seems that it is known that diablo 2 has a bug in it’s engine that makes it use the entire available CPU, which on single cores results in a 100% CPU usage and on dual cores in a 50% CPU usage of one core.

I’ve tried a lot of solutions, one of which was a process priority program, after which I’ve found out the actual cause which obviously explained why that method didn’t work.

So I figured I could solve this by running the game in a virtual machine. False. Then I figured I could try to use vmware ESX and run in a virtual machine under that for the only reason as ESX allows controlling the resources, mainly I can tell it what amount of the CPU to use for the VM. I spent a week trying to get that to work (I installed ESXi in vmware player, so yes, it works (don’t forget to enable virtualization if you don’t have it enabled in the BIOS)). After some terrible results running the copied VMs I installed a new one from scratch, put diablo on it but, it was again using full CPU however not to run diablo but to run the vm WITH diablo. And beside this, diablo wasn’t even playable. The lag was huge on the menu alone, the game itself was suicide to play.

So I dropped this version and went on to searching which now produce a pretty good result:

This little thing will actually get the process to sleep for a little bit, thus resulting in the process using less CPU. And since diablo doesn’t need that much CPU, this is all nice and dandy. THIS really works. Now I’m off to playing diablo, wihout causing my CPU to spit smoke hehehe.

Related posts

Copy files to VMWare ESX/ESXi

Thursday, November 11th, 2010

I’ve been playing with vmware esx running in vmware player (ha, you didn’t know that was possible, did you? just google it up, there are quite a few articles on the subject). And as many, my first impuls was to copy an existing vmware machine. So, I searched how to do that and in another article (again, google as I didn’t save the link) I found that I can use winscp over ssh. I first had to enable ssh and keep in mind that you CAN connect with the default root user at least from 4.1 (the article mostly say you can’t and invite you to create a new user for it, which btw in my cases I couldn’t get working for some reason). I then eventually connected through the console (yeah, you can do that to in 4.x without any other gimmicks, just press alt+f1 for the console).

Long stroy short, this is the article I finally decided to link to:

basically, it’s a real tip for winscp users which in most if not all cases configure their winscp to resume transfers (which is a natural thing to do) but in case of ESX this is not a good idea because some renaming is done in the background which esx doesn’t like.

Related posts