Add multiarch Debian 9

18 08 2017

dpkg --add-architecture i386
apt-get update
apt-get install libc6:i386

Advertisements




Debian Stretch 9 issue with vim: copy and paste

20 06 2017

In Debian Stetch 9 there is a new behaviour in vim, the copy and paste with the mouse is unusual and don’t work as the previous versions did.

For fix that, in the file /usr/share/vim/vim80/defaults.vim comment the lines:

" if has('mouse')
" set mouse=a
" endif





Enable autologin in Debian with Systemd

19 05 2017

For allow autologin in a Debian system with systemd (very usefull with testing virtual machines):

Create dir:
mkdir /etc/systemd/system/getty@tty1.service.d/

Create file /etc/systemd/system/getty@tty1.service.d/override.conf with the following content:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM

More info:
http://forums.debian.net/viewtopic.php?f=16&t=123694





Boot Debian system with EFI Stub kernel

31 08 2016

I try to explain the process of install a Debian system with UEFI and use the EFI Stub property for load the kernel and the ram disk directly from the EFI system firmware, leaving aside “grub-efi” and scratching some seconds at boot time.

– Be sure that UEFI is enabled in your system booting firmware.

– Install Debian following the normal way until the partitioning step.

– UEFI require the following partitioning points:

* Around "500MB" of space
* Bootable flag on
* Partition type "EFI System Partition"

You can select automatic partitioning, and the Debian Installation process will create it automatically or doing the partitioning by hand using the indicated values.

Don’t create this partition under software RAID or LVM, the UEFI won’t read the files under that.

– End with the installation and reboot. If it went correctly, you have a polish running system, booted with grub-uefi, with the UEFI partition mounted under /boot/efi:

/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)

– Now is time to change the boot process into a EFI Stub, copy the kernel and the ram disk into the UEFI partition:

# cp /vmlinuz /initrd.img /boot/efi/EFI/debian/

– Look for your root filesystem UUID (in this example is sda2, the place were the linux is installed):

# blkid /dev/sda2
/dev/sda2: UUID="955548bd-9c77-4893-8633-3a5e7966dfc9" TYPE="ext4" PARTUUID="4cd59271-18a2-4d00-a65a-a106ee030a1a"

– And create an entry into the UEFI firmware for the linux EFIStub (replace the UUID number with your particular reference):

# efibootmgr -c -g -L "Debian (EFI stub)" -l '\EFI\debian\vmlinuz' -u "root=UUID=955548bd-9c77-4893-8633-3a5e7966dfc9 ro quiet rootfstype=ext4 add_efi_memmap initrd=\\EFI\\debian\\initrd.img"

– Check the UEFI information, the new entry is at the bottom:

# efibootmgr -v
BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0)
Boot0001* EFI VMware Virtual IDE CDROM Drive (IDE 1:0)
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)
Boot0004* debian
Boot0005* Debian (EFI stub)
root@uefi:/boot/efi/EFI/debian# efibootmgr -v
BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0) ACPI(a0341d0,0)PCI(15,0)PCI(0,0)SCSI(0,0)
Boot0001* EFI VMware Virtual IDE CDROM Drive (IDE 1:0) ACPI(a0341d0,0)PCI(7,1)ATAPI(1,0,0)
Boot0002* EFI Network ACPI(a0341d0,0)PCI(16,0)PCI(0,0)MAC(MAC(005056948a0a,1)
Boot0003* EFI Internal Shell (Unsupported option) MM(b,e1a3000,e42ffff)FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
Boot0004* debian HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\grubx64.efi)
Boot0005* Debian (EFI stub) HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\vmlinuz)r.o.o.t.=.U.U.I.D.=.9.5.5.5.4.8.b.d.-.9.c.7.7.-.4.8.9.3.-.8.6.3.3.-.3.a.5.e.7.9.6.6.d.f.c.9. .r.o. .q.u.i.e.t. .r.o.o.t.f.s.t.y.p.e.=.e.x.t.4. .a.d.d._.e.f.i._.m.e.m.m.a.p. .i.n.i.t.r.d.=.\.E.F.I.\.d.e.b.i.a.n.\.i.n.i.t.r.d...i.m.g.
Boot0007* Debian HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\grubx64.efi

– Look close to the information reported, the BootOrder have the new entry listed first, in the next boot the system will take it:

BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003

– Now, reboot and check the BootCurrent again:

BootCurrent: 0005
BootOrder: 0005,0004,0000,0001,0002,0003

– Basically it’s done. But for update the kernel and the ram disk automatically when an upgraded is installed, or removed, create the following files and make them executable:

# cat > /etc/kernel/postinst.d/zz-update-efistub << EOF
#!/bin/sh
echo "Updating EFI boot files..."
cp /vmlinuz /initrd.img /boot/efi/EFI/debian/
EOF

# chmod +x /etc/kernel/postinst.d/zz-update-efistub# cp /etc/kernel/postinst.d/zz-update-efistub /etc/kernel/postrm.d/zz-update-efistub

As a note, is it possible to substitute this script with systemd units. Look into the Arch linux wiki for more info.

– Thats all.

 

 

— But if you have some problems:

– If you need to revert the chage, for example, to keep boot0004 first again, execute:

# efibootmgr -o 0004,0005,0000,0001,0002,0003

– If you lost the Debian entry created at installation time, recrete it with this:

# efibootmgr -c -g -L "Debian" -l '\EFI\debian\grubx64.efi'

– If you have problems with EFI variables, be sure that you have installed “efivar” and “efivars” kernel module loaded (modproble efivars).

 

More info:
https://wiki.debian.org/EFIStub
https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/
https://wiki.archlinux.org/index.php/EFISTUB
http://wiki.bitbinary.com/index.php/Debian_Wheezy_EFI_Stub





Fix dns problem with OpenVPN in Debian 8 Jessie

29 04 2015

If the openvpn connection don’t assign automatically the DNS setting from the servers, you need to put the script in the correct place.

After installing openvpn:
cp /etc/openvpn/update-resolv-conf /usr/share/openvpn/
chmod ugo+x /usr/share/openvpn/update-resolv-conf

That’s all. Connect again and review your resolv.conf





Install official vmware-view-client in Debian 8 Jessie

28 04 2015

As 2017, this document is deprecated, please, follow the method indicated here: https://elhombrequereventodeinformacion.wordpress.com/2017/02/24/1969/

 

For x64 systems aren’t available the official pacakge of Vmware View Client. The only solution is make the trick with an old Ubuntu version package and the multiarch support of Debian.

First, add the x86 multiarch support:
dpkg --add-architecture i386
apt-get update

Install Gdebi for an easy dependency resolution:
apt-get install gdebi
Download libssl and vmware-view-client from Ubuntu site or from my github account:
wget 'http://archive.canonical.com/ubuntu/pool/partner/v/vmware-view-client/vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb'
wget 'http://mirrors.kernel.org/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2_i386.deb'
wget 'https://github.com/rfrail3/misc/blob/master/vmware/vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb?raw=true'
wget 'https://github.com/rfrail3/misc/blob/master/vmware/libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb?raw=true'

Install the packages and accept dependencies:
gdebi libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb
gdebi vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb

If all was ok, the new VMware View Client is available under your desktop menu.





Running / Installing old ATI Radeon HD 2000/3000/4000 series graphic card in Debian Jessie

26 04 2015

Debian Jessie (specifically the version of Xorg that it have) don’t have support for the ATI propietary driver that manage Radeon HD 2000/3000/4000 series. As it says in the official wiki https://wiki.debian.org/ATIProprietary “is not available for Debian 8 “Jessie”, as upstream has not updated the driver for newer Xorg releases (726500).”.

For that reason, if you have an old Radeon HD 2000/3000/4000 graphic card, you can only use open source driver xserver-xorg-video-radeon wich is a reliable way to keep your computer running with the new Debian release.

In my case this is this particular graphic card:
lspci
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4330/4350/4550]

After the default installation, the system don’t boot up with the correct resolution because the kernel need to read some propietary binary firmware. You need to follow this steps for keep it running nicely:

1.- Add the non-free repositories to “/etc/apt/sources.list”:
deb http://ftp.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.debian.org/debian/ jessie main contrib non-free

2-a.- Update apt and install the following package if your systems is older than Debian Stretch:
apt-get update
apt-get install firmware-linux-nonfree

2-b.- Update apt and install the following package if your systems is newer or equal than Debian Stretch:
apt-get update
apt-get install firmware-amd-graphics

3. Reboot your computer and enjoy!

 

Interesting are the power states, check this page https://wiki.archlinux.org/index.php/ATI#Powersaving for more information and the tool radcard, maybe you can save some battery life of improve the cooling. Check the power state with the following command:
# radcard get
power_dpm_state: battery
power_dpm_force_performance_level: low

# radcard set high && radcard set perfomance
power_dpm_state: performance
power_dpm_force_performance_level: high
# cat /sys/kernel/debug/dri/0/radeon_pm_info
uvd vclk: 0 dclk: 0
power level 2 sclk: 45000 mclk: 50000 vddc: 1100

# radcard set low && radcard set battery
power_dpm_state: battery
power_dpm_force_performance_level: low
# cat /sys/kernel/debug/dri/0/radeon_pm_info
uvd vclk: 0 dclk: 0
power level 0 sclk: 30000 mclk: 40000 vddc: 1100