SEO/SEM et dev !
Linux on Vaio VPC-Z
If you’ve bought the brand new Vaio Z, with the idea to use linux on it, you might have been really disappointed, but there is hope now
Everything works but the dynamic graphic switch and the Memory Stick reader, if you have some luck and you already have some knowledge in linux.
18/01/2011 UPDATE :
kernel 2.6.37 works, no patch required !
If you experience a black screen when resuming from a suspend-to-ram, just add to /etc/pm/config.d/defaults (create it if it doesn’t exists) :
ADD_PARAMETERS="--quirk-test --quirk-s3-bios --quirk-s3-mode"
SLEEP_MODDULE="uswsusp"
And if you experience a black screen after the bootloader, add “acpi_osi=” to the boot arguments of your kernel.
In order to use the nvidia card or power it off when using the intel one, patch your bios and enable static switching.
Choose your distro
Every recent linux distro should be able to work. I’ve chosen Archlinux but Ubuntu, Debian or Fedora are ok too.
There’s only two prereqs :
- a recent kernel, higher than 2.6.30 in order to have wifi and ethernet working during the installation.
- and one more particular… : grub 1 (or grub LEGACY, grub 0.97)
Grub is the bootloader of most of linux distros, but there is two versions : 1/LEGACY/0.97 and a new one, grub2, that should be better, faster, and should provide more modularity. That new version just cause a massive freeze at boot : black screen, mad fan, high temperatures.
With Debian or Archlinux, you’re asked which bootloader you want during the installation, I advice you to choose grub1
If your vaio has the ssd raid, they will appear as separated drives during the installation, you’re free to create a new raid with linux utilities.
After the Install
Intel Graphic Card
Maybe your display works without doing anything.. If so, just let me know in the comments what’s your specific Vaio Z version.
If you’re system is freezing right after boot, go to the troubleshooting section.
Else you might certainly have random colors. Then You need to compile a 2.6.34 kernel with this patch
In order to do that, download the 2.6.34 kernel from kernel.org
then untar it ( tar xjvf linux-2.6.34.tar.bz2 ), go in his directory (cd linux-2.6.34)
Patch these kernel sources : patch -p1 < /chemin/vers/i915patch.txt
22/10/2010 update : Download these modified kernel 2.6.35-rc5 sources (edp-fixes branch from jbarnes drm-intel git repository), untar it and go into his directory.
Then follow the method depending on your distribution.
For Ubuntu :
https://help.ubuntu.com/community/Kernel/Compile.
For Archlinux :
zcat /proc/config.gz > .config # create a new .config, but you could also take mine : .config
make menuconfig # in general setup -> local version, set -KMS or whatever you want.
make all
sudo make modules_install
sudo cp arch/x86_64/boot/bzImage /boot/vmlinuz26-kms
sudo mkinitcpio -g /boot/kernel26-kms.img -k 2.6.34-KMS
then modify /boot/grub/menu.lst in order to boot on your new kernel.
Trackpad
To get it working, boot with this option : i8042.nopnp.
Add “i8042.nopnp” at the end of the kernel line in /boot/grub/menu.lst like in that example :
# (0) Arch Linux
title Arch Linuxroot (hd0,0)kernel /vmlinuz26-kms root=/dev/sda3 ro quiet i8042.nopnpinitrd /kernel26-kms.img
Graphic Switch
Without doing anything, the both cards are enabled, you can see that with lspci, it doesn’t depends on the position of your switcher. Because of a memory allocation thing, only the intel card is usable at this time but your power consumption is like you were using the nvidia one.
There is two ways for getting this switcher to work.
You could boot a first time with a kernel older than 2.6.30, switcher to stamina or speed, then restart with the right kernel.. each time you want to use your laptop, this is the more safe and boring method.
The second method is to unlock the bios advanced options, as described here: http://forum.notebookreview.com/sony/473226-insyde-hacking-new-vaio-z-advanced-menu-bios.html
- Install unetbootin then use it to install freedos on a USB key.
- Copy these files on it
- Reboot on the USB key
- type “cd C:” to go at the root of the USB key
- launch : “flashit dump.rom /g” in order to create a dump of your bios
- reboot on your linux
- download these scripts : scripts-py
- In their folder, execute : ./python advanced_menu.py dump.rom new.rom (where dump.rom is the path to your dump, and new.rom the path to the new one you’re building.)
- If there’s errors you don’t understand, stop, don’t mess your bios !
- Else, put new.rom on your key, reboot on it like before, then execute: “flashit new.rom /f” to flash your bios.
And voilà ! Press F2 at boot and you have access to the bios and all its options! So put “VGA Switching Policy” on Static, then the switcher position will works at each boot.
Bindkeys
You might want to use some keys that don’t work out of the box, like those to adjust brightness. You need to install the sony-laptop module wrote by N. Preining: http://www.logic.at/staff/preining/software/
Sound
Put that in /etc/modprobe.d/snd-hda-intel.conf :
options snd-hda-intel model=sony-assamd
Suspend to Ram (kernel 2.6.34)
The screen might not work at resume. In this case you need to execute these commands :
xrandr –output DP3 –off
xrandr –output DP3 –auto
You should put it in a script executed at system resume. Try /usr/lib/pm-utils/sleep.d/01sony-vaio (don’t forget to chmod +x it), and put in that script given by E. Lacombe :
#!/bin/sh
# light up laptop screen for vaio VPCZ11Z9E
. "${PM_FUNCTIONS}"
resume_lapscreen()
{
# export DISPLAYUSER=`ps --no-heading -o user -C start_kdeinit`
# /usr/bin/xauth add `sudo -u $DISPLAYUSER -s /usr/bin/xauth list :0.0`
/usr/bin/xrandr --output DP3 --off
/usr/bin/xrandr --output DP3 --auto
}
case "$1" in
thaw|resume) resume_lapscreen ;;
*) exit 0 ;;
esac
It doesn’t work for me, but you might be lucky
I’m still looking for a solution for achlinux+KDE4, for now I’ve setted up a bindkey that execute the xrandr commands, but at resume, my screen has only 256 colors.
Troubleshooting
System Freeze
This could be caused by modesetting on kernels before 2.6.33. You have to boot with this option i915.modeset=0 (to add in grub at boot or in /boot/grub/menu.lst)
| Print article | This entry was posted by ph0b on 01/07/2010 at 11h02, and is filed under linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 1 year ago
Thanks for the hint about the xrandr!
BTW, the reason why your script doesn’t work when called by pm-utils, is that it executes in the shell where DISPLAY and XAUTHORITY variables are not set. One way (but not very elegant) to solve it, is to use the following script instead:
#!/bin/sh
# light up laptop screen for vaio VPCZ11Z9E
. “${PM_FUNCTIONS}”
resume_lapscreen()
{
if [ x$DISPLAY = x ]; then
export DISPLAY=:0
export XAUTHORITY=`ls /var/run/kdm/.Xauth*`
fi
/usr/bin/xrandr –output DP3 –off
/usr/bin/xrandr –output DP3 –auto
}
case “$1″ in
thaw|resume) resume_lapscreen ;;
*) exit 0 ;;
esac
BTW, if you have 64-bit Linux, than the script should be placed in /usr/lib64/pm-utils/sleep.d directory.
Cheers,
joanna.
about 1 year ago
Is brightness control working? Are you using Ubuntu 10.04 amd64 ?
about 1 year ago
brightness control is working when using the intel graphics, not the nvidia. I’m using archlinux64 with kde4.4 but it’s the same for ubuntu.
@Joanna thanks for your script, I tried it but without success, /var/run/kdm/ doesn’t exist and I don’t know what should be in XAUTHORITY (echo $XAUTHORITY returns nothing in konsole), does your script works on your laptop ? which distro and graphic environment are you using ? thx
about 1 year ago
Sorry I can get a working kernel, I always get:
error: invalid magic number
error: you need to load the kernel first
just when selecting boot option in grub2.
Do you know if there are any .deb with this patched kernel?
On the other hand, when you boot which light is enabled Speed, Auto, Stamina or None?
Thanks in advance.
about 1 year ago
Which distro are you using ?
It seems you did something wrong when compiling or installing your new kernel, how do you have tried to do that ?
When I boot, the Speed led is enabled because of the bios modification I’ve described in my post.
about 1 year ago
I’m using Ubuntu 10.04 amd64.
My option is the “boring method” because I don’t want to loose my warranty.
At the moment I can boot using nvidia, but without brightness control. Then I wanna try Intel graphics card.
Thanks for your help.
about 1 year ago
Thanks to Adam, you can try these files : http://www.voip-x.co.uk/files/adam/
don’t forget to read the readme before using it !
about 1 year ago
It seems that it is not working at 1600×900 resolution, anybody working with Intel card?
about 1 year ago
What’s the exact result on your laptop with Adam’s .deb ?
about 1 year ago
Do you have an i915 patch for 2.6.35 kernel?
Some DP-D code was rewritten, so, I can’t apply the patch.
about 1 year ago
I don’t have any working patch for 2.6.35, I tried some but screen doesn’t light up.
about 1 year ago
I have a VPC-Z122GX and thanks to your guide it’s mostly usable. While I have the same blanking issue as you do resuming from suspend, changing the display brightness doesn’t work for me. Is there something else I need to do other than loading the sony-laptop kernel module?
about 1 year ago
You need to execute
/usr/bin/xrandr --output DP3 --off/usr/bin/xrandr --output DP3 --auto
at resume.
You can do that by adding a file at /usr/lib/pm-utils/sleep.d/01sony-vaio
with this content :
#!/bin/sh# light up laptop screen for vaio VPCZ11Z9E
. "${PM_FUNCTIONS}"
resume_lapscreen()
{
/usr/bin/xrandr --output DP3 --off
/usr/bin/xrandr --output DP3 --auto
}
case "$1" in
thaw|resume) resume_lapscreen ;;
*) exit 0 ;;
esac
it should works at least when you suspend by running “pm-suspend” in a terminal. You can map this command by using xbindkeys btw.
about 1 year ago
Thanks. I had already added the 01sony-vaio file. I have it bound to a key right now because it doesn’t work automatically (probably because of the XAUTHORITY issue).
What I wanted to know was how you got the keys to adjust brightness working. I installed the sony-laptop kernel module but the keys still don’t work.
about 1 year ago
Ok, you can add this simple script :
#!/bin/bashcurrent=$(cat /proc/acpi/video/GFX0/LCD/brightness | grep current | cut -c10-12)
echo $current
case "$1" in
up)
if [ "$current" == 4 ];
then
echo 16 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 16 ];
then
echo 28 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 28 ];
then
echo 40 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 40 ];
then
echo 52 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 52 ];
then
echo 64 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 64 ];
then
echo 76 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 76 ];
then
echo 88 > /proc/acpi/video/GFX0/LCD/brightness
else
echo 100 > /proc/acpi/video/GFX0/LCD/brightness
fi
fi
fi
fi
fi
fi
fi
;;
down)
if [ "$current" == 16 ];
then
echo 4 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 28 ];
then
echo 16 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 40 ];
then
echo 28 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 52 ];
then
echo 40 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 64 ];
then
echo 52 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 76 ];
then
echo 64 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 88 ];
then
echo 76 > /proc/acpi/video/GFX0/LCD/brightness
else
if [ "$current" == 100 ];
then
echo 88 > /proc/acpi/video/GFX0/LCD/brightness
else
echo 4 > /proc/acpi/video/GFX0/LCD/brightness
fi
fi
fi
fi
fi
fi
fi
fi
;;
esac
at /sbin/backlight
then add this line to /etc/sudoers :
user ALL= NOPASSWD: /sbin/backlight(replace user with your username)
and then you can use xbindkeys and add this to ~/.xbindkeysrc :
"sudo /sbin/backlight up"m:0x0 + c:233
"sudo /sbin/backlight down"
m:0x0 + c:232
it should work. If not, maybe these keys are already configured in kde (they were for me in kde 4.5, not before), and you just need to disable them.
about 1 year ago
Try adding acpi_backlight=vendor to your kernel parameters in /boot/grub/menu.lst. That fixes the backlight buttons for me. No key bindings required. The sony-laptop module has to be loaded for this to work.
about 1 year ago
Hi,, you start your post by saying that the raid will show up as seperate driver. I was wondering how I could use the default raid 0 configuration and then dualbooting with windows 7. so my question is: how can I make the rad0 show as a single drive that I can than repartition to install archlinux on it?
about 1 year ago
For a blog about linux proposing a .config to download.. you should REALLY avoid blacklisting wget user agent, lol. That’s pretty annoying to get a 403 forbidden when you paste it on the wget command line and having to go put the user agent option or use firefox or what not
about 1 year ago
lol, I apologize, that’s a global rule on my server.
Anyway, this file doesn’t really matter now there is a good 2.6.37 kernel… so I’ll let it that way.. as lol as it is
about 1 year ago
Hey, thanks a lot for this helpfull hints… I got mine Z13 working even with graphics switching. But i cannot get suspend or hibernate working. hibernate always results in a immediatelly reboot and suspend seems to work but it simply boots up if i try to wake the Z. Do you have any idea?
I use Ubuntu 10.10 with software raid, could that be the problem?
Thanks in advance
about 1 year ago
I don’t kinda get the bios hack guide
If I type c: it’s say’s bad comman
about 1 year ago
I made a small mistake in that guide, try “cd C:”
about 1 year ago
that was quick yeah it worked and srry too I also made a mistake
I mistook ”shift >” for : when it was ”Ø” in my keyboard
o_O
about 1 year ago
srry for bothering again
When I python advanced_menu.py dump.rom new.rom
it say’s that:
python: can’t open file ‘dump.rom’: [errno 2] no such file or directory
about 1 year ago
you have to copy the dump.rom you’ve just created in the file where the python script is.
about 1 year ago
Thanks for the very helpful infos on this site.
I got my Z13 almost perfectly working, except the dynamic graphic switching, witch is a little pity because the 2.6.37 kernel supports the dynamic switch between two graphic cards but the memory allocation thing prevents the issue from working.
Is that a problem of the NVIDIA driver, or where is the problems cause?
For the people who like to use the brightness control with keys when using the NVIDIA card, i wrote a small script that uses the nvidia-settings tool:
#suche nvidia Karte
/sbin/lspci | /bin/grep “01:00.0″
if [ $? -eq 0 ]; then
#echo “NVIDIA Karte gefunden…”
BR=`cat /etc/mynvidiabrightness`
MYBR=`echo “scale=1;$BR-0.1″ | bc`
echo $MYBR > /etc/mynvidiabrightness
#Punkt durch Komma ersetzen
MYBR=`echo $MYBR | sed -e “s/\./,/”`
/usr/bin/nvidia-settings -a Brightness=$MYBR
kdialog –passivepopup “NVIDIA Helligkeit: $MYBR” 1
fi
… then I used kde shortcuts to execute the script when pressing a key. The script above reduces the brightness to 10% every time is is executed.
For a script to raise the brightness you can replace the line:
MYBR=`echo “scale=1;$BR-0.1″ | bc`
with
MYBR=`echo “scale=1;$BR+0.1″ | bc`
To use the script you first have to (as root):
echo 0 > /etc/mynvidiabrightness
chmod 777 /etc/mynvidiabrightness
The script shows a small info of the brightness level on a kde enviroment. If you use gnome you can replace the line (or comment it):
kdialog –passivepopup “NVIDIA Helligkeit: $MYBR” 1
with a appropriate gnome (maybe zenity…) command.