Sunday, October 11, 2015

turning off ipv6 under Linux


Anyone familiar with networking know that the available number public ipv4 addresses is pretty much dried up. So as time goes on the move to ipv6 will only grow. However at least in parts of the US home users may not want to switch just yet. My local provider has ipv6 enabled but the performance is horrible. Pages and downloads simply drag or just stalls. Since the OS will prefer ipv6 over ipv4 when available the only option is to disable it. First check to see if you are receiving an ipv6 address by pulling the interface info from terminal

rican-linux@xubuntu-MacBookPro:~$ ifconfig wlp3s0
wlp3s0       Link encap:Ethernet HWaddr
                   inet addr:10.10.1.20 Bcast:10.10.1.255 Mask:255.255.255.0
                   inet6 addr: fe80::225:ff:fe4f:4961/64 Scope:Link
                  
inet6 addr: 2602:306:8b30:a310:225:ff:fe4f:4961/64 Scope:Global
                  
inet6 addr: 2602:306:8b30:a310::43/128 Scope:Global
                  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
                   RX packets:41182 errors:0 dropped:0 overruns:0 frame:624154
                   TX packets:21081 errors:0 dropped:0 overruns:0 carrier:0
                   collisions:0 txqueuelen:1000 
                   RX bytes:36444300 (36.4 MB) TX bytes:2165921 (2.1 MB)
                   Interrupt:21



Now to disable ipv6 globally you will need to add this statement to the end of the /etc/sysctl.conf file, net.ipv6.conf.all.disable_ipv6 = 1. Then run the command as root sysctl -p /etc/sysctl.conf. This will disable ipv6 on your system.

Hopefully in time as more places have better ipv6 support this option will not be needed.

Martin Winpress helps keep PowerPC going with Ubuntu-MATE


A great thank you needs to go out Martin Winpress.  First he is part of the team that has given PowerPC users another great Desktop Enviroment to choose from with MATE. Second he has produced a solid distro that has PowerPC support in Ubuntu-MATE.

15.04 was a horrible release for PowerPC under Ubuntu. The release came with a version of xorg that was broken under PowerPC. Many users in the Ubuntufoums were really worried about weather or not it would be fixed. Then the same bug hit Sid right after Jessie was released. Thankfully it was fixed in Debian and the fix made it in time for the 15.10 release of Ubuntu-MATE.

Another fix that made it to Ubuntu was the javascriptcore-gtk bug that crashed browsers like midori and luakit. Now you can browse the web with these lightweight browsers under Ubuntu.

The install for users with the radeon r300 driver is the same as I documented here. Sound, wireless, video playback all worked. One issue I saw and this is because I was testing on my iBook G4 is when you play video with mpv the fans kick off after a minute. This does not happen on my PowerBook G4, but it has a slightly better video card and CPU.

There was an issue with powerd crashing when I plugged in my iPhone, but it looks like that issue has been resolved.

One of really great features that come with this version of Ubuntu-MATE is an app developed by Martin called MATE Welcome. This tool gives you access to documentation, access to the community pages, and allows you to install apps.  You can find more info here.

Another tool is MATE Tweak. It allows to change your window manager without having to logout and back in. It also allows to change your DE layout to with a selection of options. If you like a traditional Windows feel then select the Redmond layout or for OS X choose Cupertino.

With 15.10 there is better iOS support. In 14.04 and even in Debian Jessie if you are running iOS 8 or later shotwell fails to import your videos and photos from your iPhone. This issue is now resolved in 15.10. I am running iOS 9 and can import my photos into shotwell on my iBook G4.

In conclusion I am really excited about Ubuntu-MATE and the option it gives PowerPC users for a modern, secure operating system. If 16.04 is a continuation of I am seeing then the next LTS version of Ubuntu-MATE will be a distro to recommend.

Screenshot with the Cupertino layout:




Wednesday, August 19, 2015

KDE is awesome!



It has been a while since I have posted anything. I have been working on getting FreeBSD working on my iBook G4 and will be posting on that shortly. I wanted to share my thoughts on running a higher end DE in Linux. Most of my posts have been on PowerPC. These machines are older and are better ran more lightweight DEs such as LXDE, XFCE, or even MATE. Running DEs such as GNOME or KDE really do not make much sense on a G4 machine that the most it can have is 2GB of RAM.

However, if you have a more modern machine with good specs then you could go for a more powerful DE. GNOME has been my DE of choice for a while. It is also the DE that my wife really enjoys. One of the features that I really like about GNOME is the keyboard integration. GNOME make it really easy to launch apps and move between workspaces with a few hits on the keyboard. It just has a really clean to look to it. However I have always wanted to try out KDE. So a few days ago a grabbed a Kubuntu 14.04 and 15.04 ISO and went on my way. I was blown away.

The first thing that I noticed right about KDE was how beautiful of a DE it is. Everything from the panel layouts, how notifications are displayed, and the look of the application really show that a lot of work has gone into making KDE aesthetically pleasing. It is also one of the most customizable DE I have seen. Some people would say that is way too customizable and I can how you can get lost in all the options. However, for me I it is not an annoyance at all. It also has a lot of compiz like features built into its window manager, kwin.

If you decide you want to give it a try I would suggest going with Kubuntu 14.04. Normally I would prefer Debian, but the current stable release does not have all the plugins for KDE. So for example I the KDE network-manager applet is not in Jessie so you need to the GNOME applet. If you are using Sid then the plugin is there.

I am currently running Kubuntu 15.04 on my 2009 MacBook Pro and even on this older machine KDE runs well. Now 15.04 is running the newer Plasma5 version of KDE. It is still pretty experimental, which is why I recommend the 14.04 version. One drawback I have found with Kubuntu is using Kontact on a Mac that is a little outdated. It is a productivity suite that manages email, contacts, and calendar. It is very resource intensive so I choose not to use to manage my email.

If you are running KDE in Debian you can choose not to install this suite if you desired. This is an advantage that Debian has over Kubuntu. However Kubuntu does give you an more straightforward out of the box experience. This may be important if someone does not want to spend time installing packages to get the DE working.

Below is a screenshot enjoy!





Saturday, June 27, 2015

Ubuntu-MATE fits my MacBook Pro nicely


I have been an OS X users for years. I was always happy how it performed. Then came Yosemite and all changed. It was just one issue after another. Safari performance was poor, my garmin would no longer work. Then came the news that iPhoto was being replaced with Photos. This new change meant that syncing photos from the iPhone to the MacBook will now require sending your picture to iCloud. No longer was there direct sync from phone to machine.

It was then I decided to move to Linux on my MacBook. Now I have been using Linux on my PowerPC machines, but kept my MacBook running OS X. So now came the decision of what distro to use.

I first started Ubuntu 15.04, but I was not happy with Unity. There was issues that made some web pages barely readable, software center was having css issues and suspend was not working well on Apple hardware. Then I went to Ubuntu-GNOME and still the same issues. Then finally I went with Ubuntu-MATE.

Ubuntu-MATE  works great on this machine. All the issues I had with the previous flavors of Ubuntu were gone. Plus all the features that Ubuntu-MATE team have added like one-click compiz activation and multi panel layout so if you are looking for OS X or Windows layout setting it up is pretty simple. The performance has been great so far. I could not recommend this flavor of Ubuntu more highly. Thanks to Martin Winpress and the team.

Tuesday, June 9, 2015

A simple TrueCrypt alternative on Linux


A lot of people who were security conscious use TrueCrypt for disk encrytion. Sadly it was discovered to contain security vulnerabilities and for a while now it has been deemed unsafe to use. Thankfully there is an effort to audit the code. So hopfully this may be resolved in the future. Till then there is a really simply way to get portable disk encryption under Linux.

First verify that the package cryptsetup is installed. If not then install it, sudo apt-get install cryptsetup. Once this is installed use the command fallacate to create a file of a paticular size (for example 100M).


rican-linux@lubuntu-powerpc:~/Public$ fallocate -l 100M test.img
rican-linux@lubuntu-powerpc:~/Public$ du -h test.img
100M test.img


What the command did was creat the file test.img and allocate 100M of disk space to it. The extension is really not needed you create a drive without it. The next steps will be to use the disk utility that comes with the Linux desktop you installed to make this file into a loopback drive then create and encrpyted partion using LUX.


First open the disk utility and select attach image.




Then goto the directory where the file is located. Before you select the file uncheck the read-only option on the bottom, then select attach. The file should now be seen as a loopback drive in the disk utility.












Once mounted use disk utility to format the loopback device with ext4.









Once the device is formated to created your encrypted partition select create new parttion.


 

Then enter the passphrase used to encrypt the volume. Be sure to make it complicated! Now you have a portable encrypted filesystem.















Saturday, May 30, 2015

Running VMs on G4 machines with LXC

It is really fun testing out different distributions. You get to see their differences and their strength/weaknesses. The one drawback is the need to keep installing ISO over and over again. I have seen people with G5 machine run qemu to host VM guests. However on G4 machine I do not think there are enough resources to really to this with taking some type of perfomance hit. Then I came across using Linux Containers (lxc) and it was exactly what I needed! So what lxc offers is virtualazation at OS level rather than on the hardware level via hypervizors. QEMU, Zen, KVM,and VB all viritalize the hardware, meaning each VM has its own dedicated hardware. Now if you have more than one core and few Gigs of RAM than this is no issue. However G4 machines at the max have 2G of ram and most are single CPU. This greatly limits what can be accomplished using hypervizors. Since lxc virtualizes on the OS level you guests will share your resources. On my iBook G4 with a single 1.42 GHz cpu and 1.5G of RAM running an instance of Debian as an lxc container performed really well. Below I will walk you through the install and set of lxc on PowerPC.

Install and Initial Setup

The following packages were the ones I used to get lxc working.
sudo apt-get install lxc bridge-utils libvirt-bin debootstrap
These will get you lxc working and allow to connect to your home network. Once you have these package installed there are somethings you need to check. First you want to be sure your kernel has all the correct configuration for lxc. The command to use is lxc-checkconfig. This will verify your kernel configuration. The output should be same as below,
rican-linux@iBookG4-Debian9:~$ sudo lxc-checkconfig
[sudo] password for rican-linux:
Kernel configuration not found at /proc/config.gz; searching…
          kernel-configuration-found-at-/boot/config-3.16.0-4-powerpc
Namespaces —-
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enablede
Multiple /dev/pts instances: enabled
—- Control groups —-
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
—- Misc —-
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
rican-linux@iBookG4-Debian9:~$
All the settings should show enabled. LXC comes with predefined templates that you can use to install containers. These templates can be found in the /usr/share/lxc/templates directory. Since this is on a PowerPC machine you can only install templates that support this architecture. Which leaves you with Debian, Ubuntu, Gentoo, and OpenSUSE. Right now I have been able to successfuly create containers for Debain and Ubuntu. There are some issue with the other two that I am looking into. Now to create a container the command to run is lxc-create. So to create a Debian container this is they syntax to use,
sudo lxc-create -n container_name -t debian
One the proces is complete a root password will be given that you should change one you launch the container and login. Before that step you should set up the networking so that you container can access the internet.

Networking

The process I used to manage my network connections is libvirt. It basically creates a vitual bridge so your VMs in the LXC containers can access the network. If you have libvirt already installed then to see if you bridge is ready run this command sudo virsh net-info default. The output should be as below,
rican-linux@iBookG4-Debian9:~$ sudo virsh net-info default
[sudo] password for rican-linux:
Name: default
UUID: d57736ba-96cc-4798-aefa-1a046fdb1de8
Active: yes
Persistent: yes
Autostart: no
Bridge: virbr0
If the active field is set to no then enable the bridge with this command virsh net-start default. The field should be now set to yes and you should see the interface if you run sudo ifconfig -a.
rican-linux@iBookG4-Debian9:~$ sudo ifconfig -a
….
virbr0 Link encap:Ethernet HWaddr 52:54:00:4a:83:be
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:454898 errors:0 dropped:0 overruns:0 frame:0
TX packets:897541 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:77865967 (74.2 MiB) TX bytes:1259670602 (1.1 GiB)
virbr0-nic Link encap:Ethernet HWaddr 52:54:00:4a:83:be
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
….
The ip address shown is controlled by this configuration file, /var/lib/libvirt/network/default.xml. This file also controls the dhcp scope of the virtual network and where you can set static reservations. You can read more on this on the Debian Wiki here.

LXC running and VNC setup

Now that lxc is install, a Debian container is created, and the networking is set,it is time to run the container and set up VNC. The command to start a container is the following,
sudo lxc-start -F -n container_name
The -F option puts you in the console on your terminal session. Once you login you want to be sure you have an ip address and can reach the internet. Once that is verified, next is to run sudo apt-get update && sudo apt-get upgrade so that the latest packages are installed. Then install the DE you want to login to. The best choice that does consume too much resources is LXDE. The command to install is simply sudo apt-get install lxde for Debain or sudo apt-get install lubuntu-desktop for Ubuntu. Finally it is time to install the VNC server. Follow the steps below,
Install the server
sudo apt-get install vnc4server
create a non-privilaged user
adduser test
su test
as the user start and stop the server
vnc4server :1 -geometry 800x600 -depth 24
vnc4server -kill :1 -geometry 800x600 -depth 24
edit the xstartup file
nano ~/.vnc/xstartup
add at the end (Debian)
/usr/bin/lxsession -s LXDE &
add at the end (Ubuntu)
/usr/bin/lxsession -e LXDE -s Lubuntu &
restart the server
vnc4server :1 -geometry 800x600 -depth 24
The server will ask for a password when it is launch for the first time. The password will be used to login via the VNC client. On the host there are a few choices for a vnc client. There are two good command line client vncviewer and vnc4viewer. When they are installed to start the session using vncviewer by entering the following,
vncviewer ip address:1
enter password
The session should open in a window and you are done! If you want a gui client then remmina is a great choice. Below are some screenshots. If you want more info on lxc check out the Debian Wiki here




Tuesday, May 12, 2015

Noobslabs is an awesome site!

I am currently running Debian Testing (Stretch) on my iBook G4. I posted a brief review of the install here.  I like spending time tweaking it out. Putting in new wallpapers, themes, and icons. Another tool I love is conky. This tool is light system monitor that displays statistics on your desktop. It is very customizable and people have shared their configurations for people to use. Sometimes these configurations are hard to implement and require some tweaking. I do not mind tinkering but sometimes I just want something to work on install. Well I came accross Noobslab and found my answer! This site is designed for people who new to Linux specifically Debian based distros like Ubuntu and Mint. They have PPAs to install themes and icon sets which make setting up themes on your Ubuntu or Mint install so much easier. They also have great start up scripts for conky as well that work any distro. They have some really great designs to choose from and you can download a wired or wireless setup depending on which interface you wish to monitor. Getting this working on my iBook was extremely simple. If you are looking for a nice conky set up then this is definitely a place to check out!.