Posts

"has modification time x in the future" and Virtualization

If you are running Linux as a guest virtual machine on a Windows host (or some other OS) using VirtualBox, you might have encountered the following error when you try to compile something on the Linux guest: make[2]: Warning: File `/media/sf_GitHub/misc/script_build/../../stack/lkm/ipstack.o' has modification time 0.51 s in the future This happens when you try to build inside a folder shared from Windows using the VirtualBox Guest Extensions. There is a minute but detectable delay between the moment when gcc tries to write the intermediate .o file from inside the Linux guest and when it is actually written to the hard disk outside on the Windows host. To get rid of the problem, just set the Linux guest's time 1 minute or so ahead of the time on Windows host.

Enabling kmemleak on Ubuntu i386 12.04.2 LTS by recompiling the kernel

While debugging a kernel module that we were developing, we wanted a kernel with some hacking options enabled, specially the  kmemleak  feature. Here is how we got that done. We were using Ubuntu i386 12.04.2 on a VirtualBox guest virtual machine running on a Windows 7 host. Make sure you have atleast 7GB of free space on your system. While creating the VM, I set my disk size (dynamically expanding) to 20GB. Also make sure you do this on the latest Long Term Support (LTS) version of the Ubuntu supported at the time. Install VirtualBox Guest editions if using a VM so that it clipboard sharing is enabled making it easier for you to copy and paste command from the Host OS to Guest OS. Update the system. This is essential as you need the very latest collection of userpace programs, kernel, and userspace-kernelspace libraries which are know to correctly work together at the time you try this. This is necessary becuase when you download the kernel sources, it will be of ...

The Europlug epidemic in India

Image
A major quantity of electrical/electronic equipment imported into India have a Europlug. The Europlug fits poorly in many Indian style 3-pin sockets. Here is the analysis of the situation. Suggested solution involves using an appropriate converter. The irritating Europlug

Redirecting kernel messages (dmesg) out through your serial port

Image
If you are into coding driver for Linux, you will know how precious those last few kernel messages are just before your module causes a system hang. So to alleviate that issue, we did to things: First we started using virtualization. We use a Windows 7 PC (Linux can be used as well) to host Ubuntu as guest using VirtualBox. We use the "oh so awesome" SublimeText editor to edit the source code of the kernel module we are developing on the Windows PC. We shared the source code folder with the Ubuntu virtual machine (VM). This made life easier because it decreased the time to reboot Ubuntu in case of a hang. And whatever few seconds were involved in reboot could be used to look through the code on the unaffected source editor which ran outside the testing machine. This setup of course would only suit you if you aren't working on developing driver for devices connected to your system bus - you will need a real physical PC running Linux exclusively for that. Secondly, we ...

Disabling Avahi (mDNS Daemon) on Ubuntu

Image
mDNS (multicast DNS) is the technology which allows you your computer, smart TV, smart phones to discover services on each other when they are connected to the same local network. Its part of the technology that enables you to play music/photos/videos on your TV from your smartphone over WiFi. mDNS is one of the techniques for enabling Zero Configuration Networking Apple's Zeroconf implementation is called Bonjour  and uses mDNS Ubuntu uses Avahi ( wiki  |  home ) as its mDNS daemon Windows uses SSDP  to implement UPnP At times, while testing protocol stacks, you might want a quiet network - one without all the service discovery packets being sent every now and then. To achieve that, you will need to disable mDNS and service discovery daemons on all the computers connected to the network. On Ubuntu 10.10 and up the following method seems to disable Avahi completely: Execute  sudo gedit /etc/init/avahi-daemon.conf  and change: start on (...

Serial Ports between Ubuntu Guests on a Windows Host using VirtualBox

Image
Aim: To establish a virtual serial connection between two Ubuntu virtual machines running on a Windows 7 host using VirtualBox. They should be able to exchange data over ttyS0 using a terminal emulation software like PuTTY. It like simulating two physical PCs both running Ubuntu, whose RS232 Ports are connected to each other using a null modem cable (TX to RX). My setup: Host OS: Windows 7 32 bit Guest1 OS: Ubuntu 10.10 i386 Guest2 OS: Ubuntu 10.10 i386 VirtualBox: 4.1.16 (The following method should work on newer versions of VirtualBox and the Host and Guest OSes. Note that Ubuntu 10.10 is no longer supported, so it is better that you try this with a new version.) Setup the environment: Install VirtualBox on your Windows PC. Create a virtual machine on it for Ubuntu. Make sure to enable COM1 and COM2 for this machine under the serial ports option and leave them as disconnected before you install Ubuntu on it. Install the latest version of Ubuntu on it using the iso ...

Disabling IPv6 on Ubuntu

There might be times when you might want to disable IPv6 support on your PC running an older version of Ubuntu (in my case 10.10) and you try out the following methods: Method 1) Simply issuing the command: sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6" might not work on older versions of Ubuntu. Method 2) Neither would the alternate method of editing /etc/sysctl.conf as shown here:  How to disable IPv6 in Ubuntu 10.04 Lucid Lynx  work on  older  versions of Ubuntu. Method 3) To conclusively disable IPv6 (on Ubuntu 10.10 for example) you need to resort to editing the command line options passed to the kernel by the bootloader (grub) as shown here:  How to disable IPv6 in Ubuntu 9.10 Karmic Koala It involves adding the line  GRUB_CMDLINE_LINUX="ipv6.disable=1" to  /etc/default/grub and running  update-grub2 Don't go by the titles of the posts linked to above, editing the kernel command line argume...