Showing posts sorted by relevance for query kernel virtualbox. Sort by date Show all posts
Showing posts sorted by relevance for query kernel virtualbox. Sort by date Show all posts

17 May 2013

419. Talking to Myself in Public: DKMS, your own kernel and Virtualbox

Brief version:
check your /lib/modules/KERNEL/build symmlinks if you compile your own kernel.

Original post:
A while back I installed the Oracle-packaged version Virtualbox 4.2 on my system since I had issues with the debian version when going above kernel 3.6 (http://verahill.blogspot.com.au/search?q=kernel+virtualbox)

It's been a bit annoying since I've had to run
sudo service vboxdrv setup

manually every time I upgrade the kernel, but it's not that much hassle. However, I've been seeing error messages such as

Error! Could not locate dkms.conf file. File: does not exist.

In addition, I've just upgraded the kernel from 3.8.8-ck1 to 3.9.2-ck1, but not rebooted, so there's no vboxdrv module for the running kernel at the moment. Both kernels were compiled on the machine they were running on.
Anyway, typically I should be able to solve that by doing
sudo dkms autoinstall -k 3.8.8-ck1

but again I get the above error about no dksm.conf file.

Troubleshooting:

The debian version
virtualbox-dkms belongs to the debian version and isn't needed for the oracle version -- installing it removes the Oracle version. Anyway, to remind myself of why I wasn't using the debian version (4.1.18-dfsg-2+deb7u1)) in Wheezy I did
sudo apt-get install virtualbox-dkms

which remove the oracle version and installed the debian one.
Building initial module for 3.9.2-ck1 Error! Bad return status for module build on kernel: 3.9.2-ck1 (x86_64) Consult /var/lib/dkms/virtualbox/4.1.18/build/make.log for more information. dpkg: error processing virtualbox-dkms (--configure): subprocess installed post-installation script returned error exit status 10
dmesg shows
[704511.419271] vboxdrv: disagrees about version of symbol module_layout
OK. False starts.

I then purged virtualbox and reinstalled the debian version:
sudo apt-get purge virtualbox
sudo apt-get install virtualbox-dkms

Same problem.
Looking at https://bbs.archlinux.org/viewtopic.php?id=151965
for i in /var/lib/dkms/*/[^k]*/source; do [ -e "$i" ] || echo "$i";done
/var/lib/dkms/vboxhost/4.1.10/source /var/lib/dkms/vboxhost/4.2.8/source
sudo rm /var/lib/dkms/vboxhost/4.1.10/source sudo rm /var/lib/dkms/vboxhost/4.2.8/source

sudo apt-get install virtualbox-dkms
Error! Bad return status for module build on kernel: 3.9.2-ck1 (x86_64) Consult /var/lib/dkms/virtualbox/4.1.18/build/make.log for more information. dpkg: error processing virtualbox-dkms (--configure):

sudo less /var/lib/dkms/virtualbox/4.1.18/build/make.log
CC [M] /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’: /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1451:38: error: ‘VM_RESERVED’ undeclared (first use in this function) /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1451:38: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [/var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o] Error 1 make[1]: *** [/var/lib/dkms/virtualbox/4.1.18/build/vboxdrv] Error 2 make: *** [_module_/var/lib/dkms/virtualbox/4.1.18/build] Error 2 make: Leaving directory `/home/me/tmp/linux-3.9.2'

The issues is known
http://siduction.org/index.php?name=PNphpBB2&file=viewtopic&t=3097
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1086030.html
http://forums.linuxmint.com/viewtopic.php?f=47&t=52496

The oracle version
I gave up and downloaded the newest oracle version again:
wget http://download.virtualbox.org/virtualbox/4.2.12/virtualbox-4.2_4.2.12-84980~Debian~wheezy_amd64.deb
sudo dpkg -i virtualbox-4.2_4.2.12-84980~Debian~wheezy_amd64.deb
Trying to register the VirtualBox kernel modules using DKMS:Error! Your kernel headers for kernel 3.8.8-ck1 cannot be found. Please install the linux-headers-3.8.8-ck1 package, or use the --kernelsourcedir option to tell DKMS where it's located Failed, trying without DKMS ... failed! Recompiling VirtualBox kernel modules:. Starting VirtualBox kernel modules: modprobe vboxdrv failed. Please use 'dmesg' to find out why ... failed!

That last 'failed' is actually ok -- I think it built, but only for 3.9.2-ck1 while the running kernel is 3.8.8-ck1.

So, good enough to use, but not good enough for a blog post, since we're back to square one.
Hmm...
ls /lib/modules/3.8.8-ck1/build -lah
/lib/modules/3.8.8-ck1/build -> /home/me/tmp/ck-kernel/linux-3.8.8

Sure, that where I built it, but it should be pointing at /usr/src/linux-headers-3.8.8-ck1
sudo rm /lib/modules/3.8.8-ck1/build
sudo ln -s /usr/src/linux-headers-3.8.8-ck1/ /lib/modules/3.8.8-ck1/build

I then did the whole purge/install dance again:
sudo apt-get purge virtualbox-4.2
sudo dpkg -i virtualbox-4.2_4.2.12-84980~Debian~wheezy_amd64.deb
Trying to register the VirtualBox kernel modules using DKMS:. Starting VirtualBox kernel modules:.
dkms status
nvidia, 304.88, 3.8.0, x86_64: installed nvidia, 304.88, 3.8.8-ck1, x86_64: installed nvidia, 304.88, 3.8.8, x86_64: installed nvidia, 304.88, 3.9.2-ck1, x86_64: installed vboxhost, 4.2.12, 3.8.8-ck1, x86_64: installed
sudo rm /lib/modules/3.9.2-ck1/build sudo ln -s /usr/src/linux-headers-3.9.2-ck1/ /lib/modules/3.9.2-ck1/build sudo dkms autoinstall -k 3.9.2-ck1 dkms status
nvidia, 304.88, 3.8.0, x86_64: installed nvidia, 304.88, 3.8.8-ck1, x86_64: installed nvidia, 304.88, 3.8.8, x86_64: installed nvidia, 304.88, 3.9.2-ck1, x86_64: installed vboxhost, 4.2.12, 3.8.8-ck1, x86_64: installed vboxhost, 4.2.12, 3.9.2-ck1, x86_64: installed
Happy again. And no dkms.conf errors anymore!

12 December 2012

290. Compiling Kernel 3.7.* on Debian (Wheezy/testing)

Update 19/12/2012
On one of my seven boxes I'm having problems with the new kernel, receiving messages such as
pci_pcm_runtime_suspend()
azx_runtime_suspend
[snd_hda_intel] returns -11
This is a known bug (https://patchwork.kernel.org/patch/1865521/), but as can be seen in that message the patch might not be included until kernel 3.8 (although one of the authors call for a backport to kernel 3.6). Again, this happened only on one out of seven computers tested so far so it might not be a universal problem. See here for how to fix it yourself: http://verahill.blogspot.com.au/2012/12/patching-kernel-371-to-fix.html

Note
 vboxdrv 4.1.18 and nvidia 304.48-1 dkms packages do not seem to play well with 3.7. This is perhaps not that surprising given that wheezy is frozen since June 2012.

* The virtualbox-dkms/vboxdrv (4.1.18-dfsg-1.1) isn't playing ball on 3.7. See e.g. https://forums.virtualbox.org/viewtopic.php?f=7&t=53031 and http://www.kubuntuforums.net/showthread.php?61234-Kernel-update-video-drivers-and-virtualbox

I solved it by going to the virtualbox website and installing their .deb package:
wget http://download.virtualbox.org/virtualbox/4.2.4/virtualbox-4.2_4.2.4-81684~Debian~wheezy_amd64.deb
sudo apt-get autoremove virtualbox virtualbox-qt virtualbox-dkms
sudo dpkg -i virtualbox-4.2_4.2.4-81684~Debian~wheezy_amd64.deb
sudo /etc/init.d/vboxdrv setup

This works absolutely fine under 3.7 and 3.7.1

* I'm also having issues with building the nvidia dkms module on this kernel. It seems to be a bug which is resolved by upgrading to a newer nvidia driver. http://www.mail-archive.com/desktop-packages@lists.launchpad.net/msg184146.html

Given that Wheezy is frozen since the end of June I suspect that we won't be seeing any fix for this. Instead I ended up installing nvidia-current (310.19) using smxi (smxi.org) and it's working fine (the alt+prtscrn screenshot bug doesn't seem to be resolved though).



Original post:
Be aware that starting with kernel 3.6 you will need to explicitly include compilation of various drivers for multimedia and webcams -- see e.g.
http://verahill.blogspot.com.au/2012/10/compiling-kernel-36-on-debian.html
http://verahill.blogspot.com.au/2012/10/leadtek-dtv-1000s-in-kernel-36-debian.html

Other than that, compiling kernel 3.7.* is pretty straightforward. The ncurses packages are needed only for 'make menuconfig'

sudo apt-get install kernel-package fakeroot build-essential ncurses-bin ncurses-dev
mkdir ~/tmp
cd ~/tmp
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.1.tar.bz2
tar xvf linux-3.7.1.tar.bz2
cd linux-3.7.1/
cat /boot/config-`uname -r`>.config
make oldconfig

and answer the questions (see bottom of the post for a list of new features).

If you want to specifically include a driver, then the easiest thing to do is:

make menuconfig

and navigating through (or search -- hit / ). E.g. saa7134 is found under Device drivers/Multimedia support/Media PCI adapters/Philips SAA7134 support. Don't forget to compile in remote control support as well if needed.

Continue (replace 4 with whatever is suitable for the number of cores on your system):
make-kpkg clean
time fakeroot make-kpkg -j4 --initrd --revision=3.7.1 --append-to-version=-amd64 kernel_image kernel_headers

This took 20 minutes on a four-core i5-2400..

mv ../linux*3.7*.deb .
sudo dpkg -i *.deb

Building failed completely on an AMD 8150FX 8 core system (See bottom of the post). It built fine on first try on all other systems.



Changes (if in doubt, hit enter for the default option):

* CPU/Task time and stats accounting
*
Cputime accounting
> 1. Simple tick based cputime accounting (TICK_CPU_ACCOUNTING) (NEW)
  2. Fine granularity task level IRQ time accounting (IRQ_TIME_ACCOUNTING)
choice[1-2]: 1
Consider userspace as in RCU extended quiescent state (RCU_USER_QS) [N/y/?] (NEW)
Module signature verification (MODULE_SIG) [N/y/?] (NEW)
Legacy cpb sysfs knob support for AMD CPUs (X86_ACPI_CPUFREQ_CPB) [Y/n/?] (NEW)
Packet: sockets monitoring interface (PACKET_DIAG) [N/m/y/?] (NEW)
IPv6: GRE tunnel (IPV6_GRE) [N/m/y/?] (NEW) 
IPv4 NAT (NF_NAT_IPV4) [N/m/?] (NEW)
IPv6 NAT (NF_NAT_IPV6) [N/m/?] (NEW)
OMAP OCP2SCP DRIVER (OMAP_OCP2SCP) [N/m/y/?] (NEW) 
 Maximum expected bad eraseblock count per 1024 eraseblocks (MTD_UBI_BEB_LIMIT) [20] (NEW)
UBI Fastmap (Experimental feature) (MTD_UBI_FASTMAP) [N/y/?] (NEW)
Calxeda Highbank SATA support (SATA_HIGHBANK) [N/m/?] (NEW)
Virtual eXtensible Local Area Network (VXLAN) (VXLAN) [N/m/y/?] (NEW) 
PCH PTP clock support (PCH_PTP) [N/y/?] (NEW)
Solarflare SFC9000-family PTP support (SFC_PTP) [Y/n/?] (NEW)
Drivers for Atheros AT803X PHYs (AT803X_PHY) [N/m/?] (NEW)
MAX310X support (SERIAL_MAX310X) [N/y/?] (NEW)
SCCNXP serial port support (SERIAL_SCCNXP) [N/m/y/?] (NEW)
TPM HW Random Number Generator support (HW_RANDOM_TPM) [M/n/?] (NEW)
TPM Interface Specification 1.2 Interface (I2C - Infineon) (TCG_TIS_I2C_INFINEON) [N/m/?] (NEW)
NXP SC18IS602/602B/603 I2C to SPI bridge (SPI_SC18IS602) [N/m/?] (NEW)
OMAP HDQ driver (HDQ_MASTER_OMAP) [N/m/?] (NEW)
Analog Devices ADT7410 (SENSORS_ADT7410) [N/m/?] (NEW)
Maxim MAX197 and compatibles (SENSORS_MAX197) [N/m/y/?] (NEW)
generic cpu cooling support (CPU_THERMAL) [N/y/?] (NEW)
Fairchild FAN53555 Regulator (REGULATOR_FAN53555) [N/m/?] (NEW)
Media USB Adapters (MEDIA_USB_SUPPORT) [N/y/?] (NEW) 
STK1160 USB video capture support (VIDEO_STK1160) [N/m/?] (NEW)
STK1160 AC97 codec support (VIDEO_STK1160_AC97) [N/y/?] (NEW)   
Enable debug for the B2C2 FlexCop drivers (DVB_B2C2_FLEXCOP_USB_DEBUG) [N/y/?] (NEW)
Media PCI Adapters (MEDIA_PCI_SUPPORT) [N/y/?] (NEW)
Enable debug for the B2C2 FlexCop drivers (DVB_B2C2_FLEXCOP_PCI_DEBUG) [N/y/?] (NEW)
Media test drivers (V4L_TEST_DRIVERS) [N/y] (NEW)
ISA and parallel port devices (MEDIA_PARPORT_SUPPORT) [N/y/?] (NEW)
Autoselect tuners and i2c modules to build (MEDIA_SUBDRV_AUTOSELECT) [Y/n/?] (NEW)
Maximum debug level (NOUVEAU_DEBUG) [5] (NEW)
Default debug level (NOUVEAU_DEBUG_DEFAULT) [3] (NEW)
Backlight Driver for LM3630 (BACKLIGHT_LM3630) [N/m/?] (NEW)
Backlight Driver for LM3639 (BACKLIGHT_LM3639) [N/m/?] (NEW)
Sony PS3 BD Remote Control (HID_PS3REMOTE) [N/m/?] (NEW)
HID Sensors framework support (HID_SENSOR_HUB) [N/m/?] (NEW)
ZTE USB serial driver (USB_SERIAL_ZTE) [N/m/?] (NEW)
Functions for loading firmware on EZUSB chips (USB_EZUSB_FX2) [M/y/?] (NEW)
LED support for LM3642 Chip (LEDS_LM3642) [N/m/?] (NEW)
LED support for LM355x Chips, LM3554 and LM3556 (LEDS_LM355x) [N/m/?] (NEW)
LED CPU Trigger (LEDS_TRIGGER_CPU) [N/y/?] (NEW)
Dallas DS2404 (RTC_DRV_DS2404) [N/m/y/?] (NEW)
Silicom devices (NET_VENDOR_SILICOM) [Y/n/?] (NEW)
Silicom BypassCTL library support (SBYPASS) [N/m/?] (NEW)
Silicom BypassCTL net support (BPCTL) [N/m/?] (NEW)
Cambridge Electronic Design 1401 USB support (CED1401) [N/m/?] (NEW)
Digi Realport driver (DGRP) [N/m/y/?] (NEW) *
STE-Modem remoteproc support (STE_MODEM_RPROC) [N/m/y/?] (NEW)
SMB2 network file system support (EXPERIMENTAL) (CIFS_SMB2) [N/y/?] (NEW)
Red-Black tree test (RBTREE_TEST) [N/m/?] (NEW)
Interval tree test (INTERVAL_TREE_TEST) [N/m/?] (NEW)
CAST5 (CAST-128) cipher algorithm (x86_64/AVX) (CRYPTO_CAST5_AVX_X86_64) [N/m/y/?] (NEW)
CAST6 (CAST-256) cipher algorithm (x86_64/AVX) (CRYPTO_CAST6_AVX_X86_64) [N/m/y/?] (NEW)
Asymmetric (public-key cryptographic) key type (ASYMMETRIC_KEY_TYPE) [N/m/y/?] (NEW)
Asymmetric public-key crypto algorithm subtype (ASYMMETRIC_PUBLIC_KEY_SUBTYPE) [N/m/?] (NEW)
RSA public-key algorithm (PUBLIC_KEY_ALGO_RSA) [N/m/?] (NEW)
X.509 certificate parser (X509_CERTIFICATE_PARSER) [N/m/?] (NEW)


AMD FX 8150
My AMD FX8150 is causing no end of problems when it comes to compiling the kernel e.g.

In file included from include/linux/dynamic_debug.h:100:0,
                 from include/linux/kernel.h:14,
                 from include/linux/sched.h:15,
                 from include/linux/blkdev.h:4,
                 from drivers/scsi/lpfc/lpfc_sli.c:22:
include/linux/string.h:23:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  /usr/share/doc/gcc-4.7/README.Bugs for instructions.
  CC [M]  drivers/scsi/lpfc/lpfc_ct.o
[..]
  LD [M]  drivers/scsi/osd/osd.o
  CC [M]  drivers/scsi/mpt2sas/mpt2sas_ctl.o
The bug is not reproducible, so it is likely a hardware or OS problem.
make[4]: *** [drivers/scsi/lpfc/lpfc_sli.o] Error 1
make[3]: *** [drivers/scsi/lpfc] Error 2
make[3]: *** Waiting for unfinished jobs....

03 March 2013

354. Some Arch linux post-installation steps/observations

I decided to temporarily switch my laptop over to Arch linux while keeping all my other boxes running debian. Luckily I had an old HDD which had Windows XP and Ubuntu (after a long hiatus from playing with Fedora Core and Mepis I got serious with Hardy Heron) that I could use -- I nuked the ubuntu install but kept the XP install for...some reason.

Still under preparation: Item 20 (chrooted firefox)

Anyway, here are some of the post installation steps I went through and some of my observations. It might help the odd debian person who explores arch. These are in addition to cosmetic things like installing the frippery extensions and faenza icon set for GNOME.

Index
0. Home partition during installation
1. There's no update-grub in Arch
2. Thinkpad
3. Changing Wallpaper in gnome 3.6
4. Get gdm to autostart
5. Get guake and conky to autostart
6. Adding a windows partition to grub2
7. Mounting ntfs partition
8. Skype and wine
9. Dropbox
10. 'apt-file' on Arch
11. Finding foreign (AUR) packages
12. No texmaker
13. systemd and network interface names
14. Virtualbox
15. grub2 theme
16. BankID
17. Truecrypt and "Failed to set up a loop device"
18. Can boot via USB but not SATA --
      "unable to find root device"
19. Problems with Guake and transparency in new tabs


0. Home partition during installation
I've covered installation of arch before (e.g. here, here and here). To have a separate home, partition your disk accordingly, and install as normal. Don't make any user while in archchroot though. Instead, edit the /etc/fstab to include the home partition, and create the user on booting from the new arch install.

UUID=b59b7022-eda1-40b8-b1e0-ada3f172ba90 /home  ext4  defaults, user_xattr  0 0

1. There's no update-grub in Arch
Instead you use
grub-mkconfig -o /boot/grub/grub.cfg

It also means that e.g. any windows installations won't be auto-detected. See below for how to deal with that.

2. Thinkpad
To get the video working you need to install xf86-video-intel
To get the mouse pad working you need to install xf86-input-synaptics
Install lm_sensors and acpi and run sudo sensors-detect to set up temperature and fan speed sensors, and battery status (acpi).
The LEDs seem to work at times with tp_smapi. Not perfect.

Problems:
the mute button doesn't work (mute immediately followed volume down works), nor does mute mic. I've tried a lot of options but so far no luck.

3. Changing Wallpaper in gnome 3.6
The debian devs may think they are simplifying things, but are often making things more difficult to discover. To change wallpaper go to the gnome overview, open Background, and click on the wallpaper in the centre of the window. THAT brings up a list over installed wallpapers etc.

4. Get gdm to autostart
systemctl enable gdm

5. Get guake and conky to autostart
sudo cp /usr/share/applications/guake.desktop /etc/xdg/autostart/

Create /usr/share/applications/conky.desktop:
[Desktop Entry]
Encoding=UTF-8
Name=Conky
Comment=Conky
TryExec=conky
Exec=conky
Icon=conky
Type=Application
Categories=GNOME;GTK;System;Utility
StartupNotify=true
sudo cp /usr/share/applications/conky.desktop /etc/xdg/autostart/

6. Adding a windows partition to grub2
You'll need to edit or create something aking to /etc/grub.d/40_custom
menuentry "Microsoft Windows XP" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr\
    search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 B8AC3A4BAC3A0482
ntldr /ntldr
}
7. Mounting ntfs partition
sudo pacman -S ntfs-3g
sudo mkdir -p /media/winxp
sudo chown $USER /media/winxp

Edit /etc/fstab
UUID=B8AC3A4BAC3A0482 /media/winxp ntfs-3g noauto,uid=1000 0 0

8. Skype and wine
You need to edit /etc/pacman.conf and uncomment the multilib repos.
[multilib] SigLevel = PackageRequired Include = /etc/pacman.d/mirrorlist

sudo pacman -Syu
sudo pacman -S wine 
sudo pacman -S skype lib32-libpulse

I originally had a qt/qt4 conflict, but updating magically took care of that. Somehow.

NOTE that to get a useable 32 bit wine install you will need to specify this. See e.g. https://wiki.archlinux.org/index.php/Wine#Using_WINEARCH

9. Dropbox
You need to get dropbox and dropbox-nautilus from AUR. Create /etc/xdg/autostart/dropbox.desktop
[Desktop Entry] Encoding=UTF-8 Name=Dropbox daemon TryExec=dropboxd Exec=dropboxd Startupnotify=true

(I first tried systemctl enable dropbox@$USER but it didn't get nautilus running properly with dropbox. The method above works.)
10. 'apt-file' on arch
...is done with pkgfile.

sudo pacman -S pkgfile
pkgfile --update
pkgfile -s libXv.so.1

11. Finding foreign (AUR) packages.
AUR packages won't update themselves so you need to uninstall and rebuild each time. To find your AUR builds, do
pacman -Qm

12. No texmaker
Texmaker is in AUR and builds fine. It's also easy to build on your own, but installing it with pacman makes it easier to keep tabs on it.

13. systemd and network interface names
My network interfaces always end up with weird names in Arch (w5pls etc.). To manually name your interfaces create e.g. 70-persistent-net.rules in /etc/udev/rules.d/
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:27:9e:27:9b:20", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:fb:b3:d2:c8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

14.Virtualbox
sudo pacman -S virtualbox virtualbox-host-modules linux-headers
sudo usermod -G vboxusers -a $USER

To load the vboxdrv module manually do
sudo modprobe vboxdrv

To auto-load on boot do
sudo su
echo "vboxdrv">> /etc/modules-load.d/virtualbox.conf
exit 

To sort out dkms:
sudo pacman -S dkms virtualbox-host-dkms
sudo systemctl enable dkms
sudo dkms install vboxhost/4.2.8


15. grub2 theme
The stock grub2 startup screen in arch is a bit bland. To spice it up, install grub2-theme-archlinux from AUR.

Edit /etc/default/grub and add
GRUB_THEME="/boot/grub/themes/Archlinux/theme.txt"
Then do
sudo grub-mkconfig -o /boot/grub/grub.cfg

It looks a lot like the mockup here: http://xcracx.deviantart.com/art/Archlinux-Grub2-mockup-121231574

16. BankID

Install bankid via AUR:
wget https://aur.archlinux.org/packages/ne/nexuspersonal/nexuspersonal.tar.gz
tar xvf nexuspersonal.tar.gz
cd nexuspersonal
makepkg -s
sudo pacman -U nexuspersonal-4.19.1.11663-4-x86_64.pkg.tar.xz
sudo pacman -S nspluginwrapper firefox
sudo nspluginwrapper --install /usr/local/lib/personal/libplugins.so

It should now work under firefox. NOTE that in order to be able to test it using test.bankid.com you must change your useragent (see e.g. http://verahill.blogspot.com.au/2013/02/341-upgradinginstalling-bankid-on-64.html). However, it will work with e.g. skatteverket and sparbanken without changing the user agent.

17. Truecrypt and "Failed to set up a loop device"
The module loop isn't loaded. Either modprobe it, or make it load automatically on boot:
sudo su
echo "loop">> /etc/modules-load.d/loop.conf
exit

18. Arch won't boot -- "unable to find root device"
I could boot from the hdd when it was tethered via USB, but not when it was attached via a sata cable. The error was something along the lines of "unable to find root device".
I solved it by following this post. http://fanweiphysicist.blogspot.com.au/2012/02/unable-to-find-root-device-archlinux.html

19. Guake bug
On my laptop, with the xf86-video-intel drivers install, opening a new tab gives me a black background instead of a transparent one.
Not sure what the proper solution to this is, but when I set up an installation on another hdd and installed the f86-video-nv and ati drivers as well, I no longer had any issues with transparency.
(Long story short: I first installed Arch on a spinning 2.5" drive and used my laptop with it for a week. Satisfied that it worked well enough, I installed Arch to my SSD by tethering it via USB to a desktop with an external nvidia card and onboard ati graphics -- so I installed all three video drivers. Putting the hdd in the laptop, guake behaved as it should with proper transparency for all tabs. Not sure what the original issue was)

20. chrooted firefox -- in progress.
For now I've installed sandfox from AUR.

First of all, read this exchange to get a feel for the scope of chroots: http://kerneltrap.org/mailarchive/linux-kernel/2007/9/19/263398/thread#mid-263398. It's not perfect as a security tool, as it wasn't meant to be one. Having said that, security works in layers and this is one which is easy to implement and adds a little bit of security.

Chrooting a programme doesn't give you any privacy or prevents firefox from leaving traces (use an encrypted and anonymous tunnel and put the chroot in a truecrypt container to cover yourself a bit more).

sudo pacman -S devtools xorg-xhost
mkdir -p $HOME/tmp/jail
sudo mkarchroot $HOME/tmp/jail/arch64 base sudo firefox flashplugin
sudo chroot $HOME/tmp/jail/arch64
passwd
useradd -m sandbox
passwd sandbox
echo "sandbox ALL=(ALL) ALL" >> /etc/sudoers
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
echo 'DISPLAY=:0.0' >> /etc/bash.bashrc
source /etc/bash.bashrc
exit

Launch the chroot with a script with something like this in it:
xhost +
sudo cp /etc/resolv.conf $HOME/tmp/jail/arch64/etc/resolv.conf
sudo mount -o bind /proc $HOME/tmp/jail/arch64/proc
sudo mount -o bind /sys $HOME/tmp/jail/arch64/sys
sudo mount -o bind /dev $HOME/tmp/jail/arch64/dev
sudo chroot $HOME/tmp/jail/arch64

You could also put 8.8.8.8 in resolv.conf (google dns).
Still not working properly (firefox segfaults)

24 March 2013

369. Compiling ECCE 6.4 on Fedora 18

UPDATE 16 April 2013:
The getops.pl issues has now been fixed in the latest release of ECCE
(http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id756/Problem_with_httpd.html)

Original post
(there were initially some issues with getops.pl being deprecated. Fixed now)

This post on the NWChem/ECCE forum got me interested in trying to build ECCE on Fedora 18.

I'm presuming that you just clicked your way through the fedora 18 installation so that e.g.  java-1.7.0-openjdk is already installed.  Note that the default partitioning scheme in Fedora may lead to a very small (<1 Gb) /tmp partition, which may prevent you from building properly, so be aware.

Building form source will solve at the very least :
* the issues of there being no 32 bit binary (build your own)
* issues with ubuntu libraries (libXfixes) if you try to install an older 32 bit binary

You'll also have access to the source code which means that you could -- at least in theory -- contribute to the project by doing bug fixes.

Building is easy once you've got all dependencies figured out. The initial run of the build script misses the detection of two required sets of packages: openGL libs, and perl-Digest-MD5

Start here

1. Download
Go to http://ecce.emsl.pnl.gov/using/download.shtml, fill out the form, and download the source code on the next page (ecce-v6.4-src.tar.gz). Create the folder ~/tmp (mkdir ~/tmp) and put ecce-v6.4-src.tar.bz2 in ~/tmp

2. Prepare
tar xvf ecce-v6.4-src.tar.bz2
cd ecce-v6.4/
export ECCE_HOME=`pwd`
cd build/
sudo yum install vim csh gcc gcc-c++ gcc-gfortran java-1.7.0-openjdk-devel python-devel ant gtk2-devel libjpeg-turbo-devel libtool ImageMagick libXt-devel xterm mesa-libGLU-devel kernel-devel perl-Digest-Perl-MD5 perl-Digest-MD5

(if you're doing this in virtualbox, the way to get openGL libs is via the virtualbox guest additions, and in order to build those you'll need the kernel headers (kernel-devel package) for the currently running kernel)

3. Build
pwd
/home/verahill/tmp/ecce-v6.4/build
./build_ecce

The script will see if all the requirements are met by stating what version is needed and echoing the currently installed version of different dependencies. Presumably all of the requirements will be met after installing the dependencies in step 2. At the very end you'll be asked

Do you want to skip these checks for future build_ecce invocations (y/n)? Y

Answer Y. The run build_ecce again and again...

./build_ecce
Xerces built
./build_ecce
Mesa OpenGL built
./build_ecce
wxWidgets built
This step will fail if you don't have openGL libs installed.

./build_ecce
running build_ext wxPython built
./build_ecce
Apache HTTP server built
./build_ecce
Making combined tar file ecce.v6.4.tar Copying NWChem binary distribution nwchem-6.1.1-binary-rhel5-gcc4.1.2-m64.tar.bz2 Copying NWChem common distribution nwchem-6.1.1-binary-common.tar.bz2 Concatenating install script and combined tar file ecce.v6.4.tar create_ecce_bin finished ECCE built and distribution created in /home/verahill/tmp/ecce-v6.4
This step will fail with
make[2]: Leaving directory `/home/verahill/tmp/ecce-v6.4/src/apps/vizthumbnail'

make[1]: Leaving directory `/home/verahill/tmp/ecce-v6.4/src/apps'

Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/verahill/tmp/ecce-v6.4/build/create_ecce_bin line 37.

BEGIN failed--compilation aborted at /home/verahill/tmp/ecce-v6.4/build/create_ecce_bin line 37.

if you don't have perl-Digest-MD5 installed.


4. Installation
You can now install ecce:
cd ..
./install_ecce.v6.4.csh

and follow the instructions. This post has an overview of the installation process, as do several of the posts here: http://verahill.blogspot.com.au/p/compilinginstalling-software-for.html

5. Patching
getops.pl has been deprecated in perl 5 -- see under incompatible changes on this page: http://fedoraproject.org/wiki/Features/perl5.16
Luckily, the fix is simple:

Assuming that you install ECCE in ~/ecce-v6.4
cd ~/ecce-v6.4/apps/scripts
sed -i 's/require "getopts.pl";/use Getopt::Std;/g' *
sed: couldn't edit codereg: not a regular file
set -i 's/Getopts/getops/g' * cd parsers/ sed -i 's/require "getopts.pl";/use Getopt::Std;/g' * set -i 's/Getopts/getops/g' *

While getopts.pl has been deprecated, Getopt::Std supplies both a getop() and a getopts() function. I've done a little bit of testing (vib calcs, energy calcs) and so far everything looks great.

If you're still having issues, make sure that Getopt is in /usr/share/perl5

6. Run
You can now have fun with ECCE

12 March 2013

357. Annoying desktop experience -- zoneminder, nouveau, nvidia and other things

This isn't a how-to post. It's basically just a description of what I went through this morning -- hopefully it'll help someone. I don't like playing around with nvidia -- and I don't have time anyway -- so I won't try to ferret out exactly what went wrong. Maybe everything was due to me failing to discover that the upgrade hadn't finished properly.

So..
(the system in question was running nvidia/kernel 3.7 at the beginning)

I had issues starting virtualbox (playing with gentoo for an upcoming post) the other day, and so decided to reboot after running apt-get upgrade (I only do it once per week/month or so -- it's my futile attempt at stability in spite of running wheezy/testing...).

On rebooting everything looked fine and I was greeted with the login screen in GDM. Trying to log in everything looks fine at the beginning...the screen flickers as if the resolution is being changed, the desktop background looks fine, conky is running...and then I'm thrown back to the GDM login again.

I'm not a stranger to other desktops. Trying KDE, LXDE, etc via GDM gave the same error.

Looking in the terminal I noticed that I had guake segfault errors, and errors along the lines of
"segfault at 968 ip [..] error 4 in libX11.so.6.3.0"

Logging in as another user gives me a message saying that I'm thrown back in to gnome classic due to lack of acceleration. Also, the desktop didn't have menus etc., and with various d-bus related errors.

Looking at
~/.xsession-errors:
update-notifier: Fatal IO error 0 (Success) on X server :0.
No protocol specified
and
/var/log/Xorg.0.log:
Display does not support NVIDIA 3D.
I then ran SMXI with the intent to test Nouveau instead of Nvidia.

As part of its process, SMXI does a dist-upgrade. It's not often I encounter errors during apt-get, so when errors popped up, I paid attention.

Turns out that Zoneminder had some issue -- zoneminder had held back the configuration of packages that I pulled in during the apt-get upgrade at the very beginning. And given that I don't do it very often, there were a lot of packages that were left unconfigured, including Xorg.

I auto-remove zoneminder and completed the upgrade. So far so good!

If that had been the end of it there would be no blog post. Still things weren't working.

Since I was already exploring the possibility of switching to Nouveau, I decided to go through with it. First I backed up my old /etc/X11/xorg.conf which has served me well in the past. Then, using SMXI I installed Nouveau (after blacklisting nvidia, and removing any nouveau blacklisting).

GDM started up fine, but I had no acceleration and GNOME 3 started in fallback mode (gnome 'classic'). I tried glxgears which told me  libGL.so.1 was missing.

However, libGL.so.1 actually existed in /usr/lib/x86_64-gnu/ -- but it pointed to libGL.so.1.2 via a symlink, and libGL.so.1.2 didn't exist.

I flailed about for a little while:
sudo apt-get install --reinstall glx-alternative-mesa
Which seemed to actually do stuff -- pulled in nvidia-installer-cleanup, glx-diversions, glx-alternative-mesa. It added lots of seemingly relevant diversions, but there was still no target for the libGL.so.1 symlink.

I then got fed up with the Nouveau/GNOME 3 combination.

I decided to bet on NVIDIA again, and had the fairly reasonable idea that the issue was the updated Xorg version -- simple nvidia update might've helped

Since I had kernel 3.7 installed, and 3.8 supports NVIDIA/DKMS I figured I might as well install a 3.8 kernel I had compiled on a different computer before continuing.

After upgrading to kernel 3.8, I blacklisted nouveau in /etc/modprobe.d/blacklist.conf ('blacklist nouveau').
I manually made sure that there was no nvidia or nouveau loaded by rmmod:ing them and checking with lsmod.

I then ran smxi and installed debian-nvidia.

Reboot.

Black screen with cursor. No graphical environment.

lsmod showed that nouveau hadn't respected my blacklisting.

Edited my /etc/default/grub to read
GRUB_CMDLINE_LINUX_DEFAULT="quiet nouveau.blacklist=1"
then ran update-grub, followed by restoring my old xorg.conf.

And...then everything worked! lsmod shows that nouveau isn't loading anymore (blacklisting should be ok,  no?) and I can now log in to gnome 3 as normal with normal acceleration.

I'm not sure what the underlying problem was -- nouveau not respecting my blacklisting hasn't been an issue before, so that was a bit of a surprise. But it was probably fine before I installed nouveau (I can't uninstall it for some retarded reason since it pulls too many packages with it), and not the source of the original issues. Probably the new xorg version didn't play fine with the installed version of nvidia, which is almost expected.

I'm still peeved with the Nouveau/GNOME 3 situation though -- binary blobs shouldn't be required to simply to use a basic desktop. I can understand if nouveau isn't a stand in for nvidia -- it's a reverse engineered open source alternative after all -- but why is gnome 3 requiring so much grunt?

05 March 2012

92. Installing debian in virtualbox -- in pictures

Here's a ridiculously detailed set of screengrabs of how to install debian in virtualbox. It ends with a five-point list of things to do post-install. My motivation was to create a sparse build environment which would help me hammer out depencies.

VIrtualbox can be handles completely in the terminal too:

In particular,  starting an existing machine:
me@beryllium:~$ VBoxManage startvm debian_barebone

Waiting for VM "debian_barebone" to power on...
VM "debian_barebone" has been successfully started.

Just make sure that you've opened up portforwarding for ssh:
VBoxManage modifyvm "debian_barebone" --natpf1 "guestssh,tcp,,2222,,22"

A very similar guide, but which shows the installation of LXDE is here: http://verahill.blogspot.com.au/2012/06/ecce-in-virtual-machine-step-by-step.html

Anyway: the graphical way:


Setting up the virtual machine

Name the vm and select os type and version

The amount of RAM you give the VM depends on what you will use it for.

Create a new harddisk


VDI is for virtualbox, VMDK is for VMWare

Dynamic will start small and grow as files are added.

A minimum of 3-4 GB is recommended, or apt cache might eat up all your space

And you're almost done.

Attach the debian install iso

USB is optional.


You can add a shared folder, but it's not necessary.

Don't touch this -- just make sure that the network adapter is enabled

Optional
Start the virtual machine, which will launch the installation.


Installing debian


The installation procedure is the same as on a 'real' computer.

Pick a language...

...a country...

...a keyboard layout...

...and let debian do a bit of preparation.

Choose a hostname. 

Normally leave domain blank.

Leave root password blank. This way sudo will be the default way of administration.

Leave blank.
Pick a name, any name.

Debian will suggest a user name based on the real name, but pick anything.

Pick a password. You'll have sudo access by default, so pick a good one.

Repeat your password

What about Melbourne/Victoria???

Normally Guided is a bad idea.

First you need to 'format' your harddrive

It won't touch your REAL harddrive, so relax

Create a partition -- we'll only create one linux partition, /

Create a new partition

Give it most of the space on your HDD, but not all


Primary is a good choice. Logical only acts as a container, and isn't necessary for  such a small setup.


Just go for the default settings.

Time to create a small swap, since we only gave our VM 256 Mb

Give the swap everything remaining

Primary again

Select Use as...

...SWAP

All is good

Make changes permanent

Write changes

Pick the generic kernel

...like so

Unless you do have another CD, don't bother

If you're connected to the net, go ahead and use a mirror














First boot







Things to do after installation:

0. With your virtual machine turned off, on the (linux) host do
 VBoxManage modifyvm "debian_barebone" --natpf1 "guestssh,tcp,,2222,,22"
to allow you to ssh to your virtual debian installation using
ssh verahill@localhost -p 2222

Boot your virtual machine and
1. Remove the CD from the /etc/apt/sources.list

2. sudo updatedb to populate the locate database
3. sudo apt-get install bzip2 to avoid the i18n header error:
W: Failed to fetch copy:/var/lib/apt/lists/partial/server_pub_linux_debian_dists_wheezy_non-free_i18n_Translation-en  Encountered a section with no Package: header
3. sudo apt-get update

4. install ssh server: sudo apt-get install openssh-server

5. Install a graphical environment: See this guide
The shortest summary of that would be:
sudo apt-get install lxde
sudo shutdown -r now