Saturday, March 7, 2015

Linux Mint: Install new kernel version and update Virtual Box kernel module

Objective


I want to install the latest Linux Kernel available for my system. I also want still to work with my already installed VirtualBox which needs to install a kernel module after a kernel switch.

Motivation


There was no real resaon behind my plans to install the Linux Kernel 3.17.1. I just thought it's time for an upgrade. My current kernel is 3.13.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • Oracle VM VirtualBox Manager 4.3.24

Solution


Install the Linux Kernel packages


To check which kernel packages are currently available you can do a search like (filtered by version "3.17"):

$> apt-cache search linux- | grep 3.17

you'll see some output like this:

linux-headers-3.17.1-031701 - Header files related to Linux kernel version 3.17.1
linux-headers-3.17.1-031701-generic - Linux kernel headers for version 3.17.1 on 64 bit x86 SMP
linux-image-3.17.1-031701-generic - Linux kernel image for version 3.17.1 on 64 bit x86 SMP

For 64-Bit systems download the following packages ...

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701_3.17.1-031701.201410150735_all.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701-generic_3.17.1-031701.201410150735_amd64.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-image-3.17.1-031701-generic_3.17.1-031701.201410150735_amd64.deb

and for 32-Bit systems download the following ...

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701_3.17.1-031701.201410150735_all.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701-generic_3.17.1-031701.201410150735_i386.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-image-3.17.1-031701-generic_3.17.1-031701.201410150735_i386.deb

Now install the packages:

$> sudo dpkg -i linux-headers-3.17.1*.deb linux-image-3.17.1*.deb

Reboot the system.

$> sudo reboot

After a successful reboot, you can delete the *.deb packages again:

$> rm linux-*


Uninstall the Linux Kernel again (if you don't like it anymore)


You can uninstall the new kernel with the following command, be aware that this may make your system unusable.

$> sudo apt-get remove 'linux-headers-3.17.1*' 'linux-image-3.17.1*'

Setup the VirtualBox Kernel module


$> sudo /etc/init.d/vboxdrv setup

You'll see output similar to:

Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.

Now you are done!

Linux Mint: Install and configure OpenSSH

Objective


It should be possible to log-into my new desktop computer from my laptop via ssh.

Motivation


Sometimes I want to run a script or program on my more powerful desktop computer, also while I am just sitting in front of my laptop. Furthermore I want to be able to configure my desktop computer from remote. To achive this I need to install and configure openssh inclusive X11 forwarding.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • A second computer or laptop with a ssh-client e.g. putty installed

Solution


Install the OpenSSH packages


Open a terminal. Download and install the openssh server and client package:

$> sudo apt-get install openssh-server openssh-client

you'll see some output like this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-client is already the newest version.
Suggested packages:
rssh molly-guard monkeysphere
Recommended packages:
ncurses-term ssh-import-id
The following NEW packages will be installed:
openssh-server openssh-sftp-server
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 354 kB of archives.
After this operation, 1.072 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-sftp-server amd64 1:6.6p1-2ubuntu2 [34,1 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-server amd64 1:6.6p1-2ubuntu2 [319 kB]
Fetched 354 kB in 0s (781 kB/s)
Preconfiguring packages ...
Selecting previously unselected package openssh-sftp-server.
(Reading database ... 159066 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a6.6p1-2ubuntu2_amd64.deb ...
Unpacking openssh-sftp-server (1:6.6p1-2ubuntu2) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a6.6p1-2ubuntu2_amd64.deb ...
Unpacking openssh-server (1:6.6p1-2ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up openssh-sftp-server (1:6.6p1-2ubuntu2) ...
Setting up openssh-server (1:6.6p1-2ubuntu2) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
ssh start/running, process 3190
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...

Configure OpenSSH


The default configuration for OpenSSh on Linux Mint Rebecca located at /etc/ssh/sshd_config should already work fine without any further adjustment. The only limitation is that yout cannot log in as root by default.

If you want to allow remote login as root, open a shell and edit /etc/ssh/sshd_config:
$> gksu gedit /etc/ssh/sshd_config

Now change the following line to:

PermitRootLogin yes

Now you are done and can do a test log-in.