Monday, January 19, 2009

intel/amd Hardware virtualization CPU capability

I've often wondered if a computer I'm using (a laptop, or my work desktop) has hardware virtualization support. There are quite a few sites that say "cat /proc/cpuinfo | grep flags and look to see if there are vmx or svm flags in there", e.g.

http://www.linuxtopia.org/HowToGuides/fedora_core_6_xen_quickstart/fedora_core_6_xen_virtualization_how_to_005.html

and

http://www.howtogeek.com/howto/linux/linux-tip-how-to-tell-if-your-processor-supports-vt/

Now I've done that and it's a pain because there are so many flags and they're not in an order that makes it easy to spot the relevant flags. So I did some sed:

cat /proc/cpuinfo | grep flags | sed "s/ /\\n/g" | egrep "(vmx|svm)"

which is more useful since it replaces spaces in the flags with newlines, so that we can then search for just the flags we need and not be confused by the pollution from all the other flags on the line.

Without the trailing egrep I get:

flags :
fpu
vme
de
pse
tsc
msr
pae
mce
cx8
apic
sep
mtrr
pge
mca
cmov
pat
clflush
dts
acpi
mmx
fxsr
sse
sse2
ss
ht
tm
pbe
nx
constant_tsc
arch_perfmon
bts
pni
monitor
vmx
est
tm2
xtpr
flags :
fpu
vme
de
pse
tsc
msr
pae
mce
cx8
apic
sep
mtrr
pge
mca
cmov
pat
clflush
dts
acpi
mmx
fxsr
sse
sse2
ss
ht
tm
pbe
nx
constant_tsc
arch_perfmon
bts
pni
monitor
vmx
est
tm2
xtpr

As it happens, although I *do* have vmx in there, I doubt if it's actually usable. I've got two laptops with vmx enabled, but I expect that the hardware virtualization is disabled in the BIOS, and there's no toggle in the CMOS settings to turn it on. But I'll try to install Xen anyway, and see if it can use the CPU hardware virtualization support :-).

It's too bad that those are my two slower laptops (2.2Ghz and 1.6Ghz). My fastest laptop (3.3Ghz) is the oldest and it definitely doesn't have vmx support in there at all. Ah well, maybe I'll just play with Xen and hardware virtualization on my AMD64 desktop at work.

Sunday, January 11, 2009

vlc on intrepid, no video

I recently installed Ubuntu 8.10 (Intrepid) on laptops at home. I also installed vlc (well, on one computer vlc was already installed on Hardy and I just dist-upgraded). I would see no video but could hear sound. Some googling a week or so ago didn't help.

Today though I found this:

cannot play any video (SOLVED) on the videolan forums.

That solved the problem perfectly. The solution being, at the command line, to run:

vlc --reset-plugins-cache --reset-config


Linked to here so that its google karma will rise (not that it needs it, since it's already the first result :-).

Friday, January 09, 2009

xchat and DSL router woes

I've had some problems with xchat when working at home. This is on Ubuntu 8.10 (Intrepid).

I lurk on irc.freenode.net's #erlang channel (sometimes I ask embarrassingly newbie questions).

The first issue (backwards from the title) is that my home DSL router (provided by my ISP) is crap (but I don't replace it because it's free). The DSL-604T has some sort of issue with some ip_conntrack settings being too low, so that when it receives too many incoming connections at the same time or within a short amount of time (e.g., when running a peer-to-peer client, or when in the #erlang channel, apparently, although I don't understand why that is) then the router hangs and I need to power-cycle it.

There are firmware upgrades for this model, but I can't upgrade the firmware since it might then stop working with my ISP (the ISP has custom firmware in there).

This isn't even about running peer-to-peer, it's about an IRC channel about a programming language!

So I solved that by setting up screen to open an ssh session (at screen #9) to do an auto-port-forward to my work computer. ssh -L 8001:irc.freenode.net:8001 my_work_computer. Then I just have xchat connect to localhost:8001. It's simpler than figuring out how to NAT requests to port 8001 through my work computer and cheaper on bandwidth than running xchat in vnc at work (my ISPs bandwidth caps have increased by a factor of 3 since i first whined about the caps, but I still hit the limit before the end of the month).

So then I remembered that xchat on ubuntu sucks because there's no graphical way to turn off join and parts messages. And on a channel with a lot of lurkers (like #erlang), there are a lot of those.

A quick google search shows that the thing to do is

/set irc_conf_mode 1

And I can have that done automatically by:
Xchat|Network List|Select Network|Edit

and setting the Connect command to "/set irc_conf_mode 1".
It'd be nice if it were settable in the graphical interface, but
since it isn't, this is a neat workaround.

Saturday, January 03, 2009

Toshiba Satellite A75-S231 bios password clearing

I've had a heck of a time trying to get a Toshiba Satellite A75-S231 working well with Linux. I first received this laptop (secondhand) around 2006, I think. I couldn't use it productively in Ubuntu (I think I might have checked some other distros, certainly I checked Knoppix too) back then. Whenever I would do something compute intensive it would shut down. It seems the kernel wasn't controlling the fans and it was overheating and the BIOS would turn it off.

I could sort of limp along and use it if I set the cpu scaling to its lowest speed. But that was still 1.8Ghz (no 800Mhz speeds on this CPU). And even at 1.8Ghz, if I did anything challenging that would use 100% cpu for a few minutes, it would shut down.

So I gave up. For a while I lent the laptop to someone who used XP on it, and after that it was stored in its laptop case for a year or so.

Well this year we moved to New Zealand, and since my sister-in-law was coming over, and I'd forgotten what the myriad issues with the laptop had been, I asked her to bring it with her.

I tried to install Solaris 10 on the ubuntu partition. That didn't end well. I'll try it again, but it looks like Solaris 10 probably doesn't know how to run the fans either. I then installed Ubuntu 8.10 (Intrepid). That installed and it didn't hang. It looks like linux got the fan working sometime between Feisty (I think) and Intrepid.

I had another problem with the laptop. I had received it with the bios security password set and my brother, who gave me the laptop, didn't remember what the password was. Back when the laptop was shutting down due to power, I'd thought that if I could get into the CMOS setup, I could find a setting so that the fan would always run if it was on AC power. But first I had to get into the BIOS.

Well, this year, with Intrepid working on it, the urgency of getting into the BIOS receded. I still wanted to clear the passwords though. After a lot of searching, I finally found:

Toshiba Laptop password deletion

On page 8 that shows the jumper to short to clear the BIOS password. So finally I can get into the CMOS setup. As it happens, there's no "keep-the-fan-on-all-the-time" setting. As with many (all?) laptop BIOSes, it's pretty minimal. I can't even set how much RAM is shared by the video subsystem. It's good to finally be able to see what's in there though (and set the boot order of the drives, fortunately, previously the boot order had CD-DVD-Rom first, which allowed me to install Linux in the first place).

This laptop still has other problems. I've never liked how insensitive the Alps glidepoint touchpad is, and the keyboard is pretty weak (there's no right Ctrl key, and I always use right Ctrl instead of Left Ctrl, the ~` key is beside the space bar, which is stupid). But that's the case with all laptop keyboards anyway, compromises are made and they all suck. I can deal with the keyboard though, mostly. And if I can't stand it anymore, I've got a cheap external keyboard I can use with it. I still hate the touchpad, but some tweaking of gnome mouse settings has the mouse being tolerable. I'll probably still buy an external mouse and use that though. The laptop is big enough (and I'm switching to it because I like the widescreen) that it's really a desktop replacement. For travelling, we'll bring sol's much lighter (and still widescreen) HP Pavilion.

As long as I'm going to use an external keyboard/mouse, I'd love to have this Adesso keyboard with built-in touchpad (well, assuming the touchpad is any good, but it probably is, most touchpads are, the -one in the Satellite A75-S231 I've got is just bad, not sure if it's bad for all instances of that model, or if I've just got a dud). I can't find that keyboard in New Zealand though, and frankly, I won't spend that much for a keyboard+mouse. I'll just grab a cheap external mouse.

I'll keep my other laptop (a Durabook) for a spare. Or probably for Solaris (not that I need Solaris, but I might as well play with it and get familiar with it, I'm sure I'll use it since the big client my department does software development and management for is big on enterprise everything).