/etc/udev/rules.d/70-persistent-net.rules makes network unavailable

After launching a VM, sometimes network becomes unavailable until you manually remove

[root@j3ffyang~]# rm -fr /etc/udev/rules.d/70-persistent-net.rules

The workaround is to stop generating this rule

mv /lib/udev/rules.d/75-persistent-net-generator.rules /tmp

To process this in batch

for i in `cat /tmp/allnode.lst | awk '{print $1}'`; \
do echo $i; ssh $i 'mv /lib/udev/rules.d/75-persistent-net-generator.rules /tmp/'; \
done

 

Posted in linux, opensource, script, shell, virtualization | Tagged , , , | Comments Off

Dual- boot of MacBook Pro and Ubuntu. Change Boot Sequence

I’ve installed Ubuntu on my MacBook Pro (Retina 2013 November edition) and enabled dual- boot by rEFInd (reference http://www.rodsbooks.com/ubuntu-efi/). By default the system boots into Windows partition which does NEVER exist.

Here is the step how to change boot sequence to #Ubuntu

  • Boot into Mac OS
  • Update refind.conf
    sudo vi /etc/EFI/refind/refind.conf
  • Look for “manuentry” and find out the sequence of booting
  • Update the value of “default_selection”

This is the “menuentry” from my machine

# A sample entry for a Linux 3.3 kernel with its new EFI boot stub
# support on a filesystem called "KERNELS". This entry includes
# Linux-specific boot options and specification of an initial RAM disk.
# Note uses of Linux-style forward slashes, even in the initrd
# specification. Also note that a leading slash is optional in file
# specifications.
menuentry Linux {
icon EFI/refind/icons/os_linux.icns
volume KERNELS
loader bzImage-3.3.0-rc7
initrd initrd-3.3.0.img
options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"
disabled
} 

# A sample entry for loading Ubuntu using its standard name for
# its GRUB 2 boot loader. Note uses of Linux-style forward slashes
menuentry Ubuntu {
loader /EFI/ubuntu/grubx64.efi
icon /EFI/refined/icons/os_linux.icns
disabled
}

# A minimal ELILO entry, which probably offers nothing that
# auto-detection can't accomplish.
menuentry "ELILO" {
loader \EFI\elilo\elilo.efi
disabled
}

“default_selection 2″ leads you to boot into Ubuntu

Posted in linux, opensource, ubuntu | Tagged , , , , , , , | Comments Off

Install Skype on Ubuntu Saucy x86_64

Download Skype 32bit, install then receive the following error

skype: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

Find out which package contains libXss.so

jeff@umac:~$ sudo apt-file search libXss.so
libxss-dev: /usr/lib/x86_64-linux-gnu/libXss.so
libxss1: /usr/lib/x86_64-linux-gnu/libXss.so.1
libxss1: /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
libxss1-dbg: /usr/lib/debug/usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
jeff@umac:~$

Install libXss package

sudo apt-get install libxss1

Reference: http://askubuntu.com/questions/59703/skype-error-while-loading-shared-libraries-libxss-so-1-cannot-open-shared-obj#

 

 

Posted in linux, ubuntu | Tagged , , | Comments Off

Enable Internal Speaker in Ubuntu Saucy on Mac

Run the command in shell

hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1

And place it into /etc/rc.local

Posted in linux, opensource | Tagged , , , | Comments Off

How to Share a VPN from VM on Mac

Because our OpenConnect VPN from company provides a very poor connection for Mac, I switch to share an AT&T Global Network (AGN) VPN running in a Ubuntu VM inside of Mac OS. Here are the steps

  • On Mac Install VirtualBox on Mac and install Ubuntu 12.04 32bit VM in VirtualBox.
  • Launch Ubuntu and install AGN. Login your AGN account.
  • In Ubuntu VM, in /etc/sysctl.conf, turn on ip_forward
    net.ipv4.ip_forward=1
  • Make this change effective
    sudo sysctl -p
  • Enable POSTROUTING chain by IPTables. Assume your home network is 192.168.1.0/24
    iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o tun0 -j MASQUERADE
  • On Mac OS, only 2 steps further
    sudo route delete default 192.168.1.1
    sudo route -nv add default 192.168.1.186

Notice: 192.168.1.186 is IP address of Ubuntu VM, which becomes a router

Posted in hypervisor, linux, opensource, security, virtualization | Tagged , , , , , , | Comments Off

Install Ubuntu Saucy on Macbook Pro

Writing this blog for sharing my experience. No guarantee at all. Got a brand new Macbook Pro (Retina, 8G ram, 500G SSD) when traveling to Hong Kong for OpenStack Summit. Spent 2 days to figure out installing Ubuntu Saucy 13.10 x86_64bit specifically for Mac (downloadable from http://releases.ubuntu.com/saucy/ and look for 64-bit Mac (AMD64) server install image) over it.

  1. (optional) Partition 2 disks. 250G each and use the 1st one to reinstall Mac OS from internet. Boot into internet recovery by holding “command” + “alt/option” + R and pressing “power” button. This isn’t a must. I just resized the partition to give another 256G to Ubuntu.
  2. After installing Mac OS, download and install “rEFInd“. You can refer to http://sourceforge.net/projects/refind/ . You’d install from the zip that you download by executing ./install.sh
  3. Insert Ubuntu live USB then boot into it. The partition layout looks like
    /boot 200M
    swap  8G
    /     20G
  4. Since network driver is not correctly loaded at this morning, I use tethered network from an Android device hooking to my Ubuntu box. Therefore I get the network to download packages.
  5. After Ubuntu boots up, you have to convert Ubuntu into EFI mode. Refer to https://help.ubuntu.com/community/UEFI#Converting_Ubuntu_into_EFI_mode
    As the above instruction, you’d install boot-repair (Install “Boot-Repair” (https://help.ubuntu.com/community/Boot-Repair). It takes a little bit time but just follow the instruction to convert grub boot in EFI.
  6. After restart Ubuntu, install the exact Wi- Fi driver. To figure out what wireless hardware installed in your Mac
    $ lspci -nn -d 14e4:
    03:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

    Then install the particular driver

    apt-get install bcmwl-kernel-source
    modprobe wl
  7. Load audio driver for internal speaker
    hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1

Thanks to the references that I got during writing this blog :-)
http://www.miek.nl/s/37ebe31bd0/
https://help.ubuntu.com/community/UEFI#Converting_Ubuntu_into_EFI_mode
http://askubuntu.com/questions/315950/drivers-for-wireless-card-asus-pce-ac66

 

 

Posted in linux, opensource | Tagged , , , , , | Comments Off

Enable Sametime in Pidgin

For some reason, Sametime plugin is removed off Pidgin. Here is the way to re- enable it

sudo dpkg -l | grep meanwhile
ii libmeanwhile1 2.0 all Blocks meanwhile to maintain some policy
sudo apt-get purge libmeanwhile1 pidgin
sudo apt-get install -t saucy libmeanwhile1 pidgin

-t is the key to make sure the Sametime library is installed from public Saucy repository

sudo dpkg -l | grep meanwhile
ii libmeanwhile1 1.0.2-4.1 amd64 open implementation of the Lotus Sametime Community Client protocol

 

Posted in opensource | Tagged , , , | Comments Off