安裝 indicator-virtualbox on Ubuntu 12.04

自從 Ubuntu 11.04 改用 Unity 以後,原先 Gnome 2 狀態通知區就有了大變動,從原先的 Applet 改為 Indicator 了!而 Indicator 在字面上可以翻成指示者、信號...... 但在這裡則是代表右上角狀態通知區的小工具。

當中凍仁最喜愛的是 indicator-virtualbox,這對需要常開虛擬機器 (Virtual machine) 測試各個作業系統 (Operating system) 的凍仁而言是個好物,相信重度使用者都會喜愛它!


indicator-virtualbox 操作預覽。

目前在 Launchpad 上只有 10.04 (lucid), 10.10 (maverick) 及 11.04 (natty) 的版本,至於 12.04 (precise) 呢?動手編一下就可以了,開放原始碼真的很好用呢

啟動後會於右上角的狀態通知區新增個 Virtualbox 的圖示。

關於 indicator-virtualbox 1.1.1。

1. 事前準備

1.1. 由於 indicator-virtualbox 是專門控管 virtualbox 的小工具,故在使用前須先安裝 virtualbox。
[ jonny@precise ~ ]
$ sudo aptitude install virtualbox [Enter]

1.2. 因作者 Michael Otto 於 1.1.0 時加入檢查機制,故執行 indicator-virtualbox 前須先執行一次 virtualbox。
[ jonny@precise /dev/shm/indicator-virtualbox-1.1.1 ]
$ cat ChangeLog [Enter]
1.0.0 to 1.1.0
-----------------
* Add "VirtualBox" to menu
* check the file "~/.VirtualBox/VirtualBox.xml" is aviable

0.9.0 to 1.0.0
-----------------
* First release
* Bugs #683652, #683862, #684260 fixed

2. 使用 dpkg 安裝

若您覺得步驟 3 過於繁雜,可以安裝凍仁打包的 deb。 [1]

2.1. 下載 indicator-virtualbox_1.1.1~chusiang~precise1_amd64.deb
[ jonny@precise ~ ]
$ wget https://www.dropbox.com/s/b85nx5vmc86vceg/indicator-virtualbox_1.1.1~chusiang~precise1_amd64.deb [Enter]

2.2. 安裝。
[ jonny@precise ~ ]
$ sudo dpkg -i indicator-virtualbox_1.1.1~chusiang~precise1_amd64.deb [Enter]

3. 自行編譯並安裝

3.1. 安裝相關套件。
[ jonny@precise ~ ]
$ sudo aptitude install checkinstall dh-autoreconf libcurl3-dev libxml2-dev libgtk2.0-dev libdbus-glib-1-dev libappindicator-dev [Enter]

3.2. 下載 indicator-virtualbox-1.1.1.tar.gz
[ jonny@precise ~ ]
$ wget https://launchpad.net/indicator-virtualbox/1.1/1.1.1/+download/indicator-virtualbox-1.1.1.tar.gz [Enter]

3.3. 解壓縮。
[ jonny@precise ~ ]
$ tar zxvf indicator-virtualbox-1.1.1.tar.gz -C /dev/shm/ [Enter]

3.4. 切換目錄。
[ jonny@precise ~ ]
$ cd /dev/shm/indicator-virtualbox-1.1.1/ [Enter]
[ jonny@precise /dev/shm/indicator-virtualbox-1.1.1 ]
$

3.5. 編譯。
[ jonny@precise /dev/shm/indicator-virtualbox-1.1.1 ]
$ sudo ./autogen.sh && sudo ./configure && sudo make [Enter]

3.6. 打包 deb 並安裝。
[ jonny@precise /dev/shm/indicator-virtualbox-1.1.1 ]
$ sudo checkinstall -D make install [Enter]

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: [Enter]

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.
>> 

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values: 

0 -  Maintainer: [ root@elite-8300mt ]
1 -  Summary: [ Package created with checkinstall 1.6.2 ]
2 -  Name:    [ indicator-virtualbox ]
3 -  Version: [ 1.1.1 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ indicator-virtualbox-1.1.1 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ indicator-virtualbox ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...

========================= Installation results ===========================
Making install in po
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/po'
linguas="de ru uk "; \
for lang in $linguas; do \
dir=/usr/share/locale/$lang/LC_MESSAGES; \
/bin/bash /dev/shm/indicator-virtualbox-1.1.1/install-sh -d $dir; \
if test -r $lang.gmo; then \
/usr/bin/install -c -m 644 $lang.gmo $dir/indicator-virtualbox.mo; \
echo "installing $lang.gmo as $dir/indicator-virtualbox.mo"; \
else \
/usr/bin/install -c -m 644 ./$lang.gmo $dir/indicator-virtualbox.mo; \
echo "installing ./$lang.gmo as" \
"$dir/indicator-virtualbox.mo"; \
fi; \
if test -r $lang.gmo.m; then \
/usr/bin/install -c -m 644 $lang.gmo.m $dir/indicator-virtualbox.mo.m; \
echo "installing $lang.gmo.m as $dir/indicator-virtualbox.mo.m"; \
else \
if test -r ./$lang.gmo.m ; then \
/usr/bin/install -c -m 644 ./$lang.gmo.m \
$dir/indicator-virtualbox.mo.m; \
echo "installing ./$lang.gmo.m as" \
"$dir/indicator-virtualbox.mo.m"; \
else \
true; \
fi; \
fi; \
done
installing de.gmo as /usr/share/locale/de/LC_MESSAGES/indicator-virtualbox.mo
installing ru.gmo as /usr/share/locale/ru/LC_MESSAGES/indicator-virtualbox.mo
installing uk.gmo as /usr/share/locale/uk/LC_MESSAGES/indicator-virtualbox.mo
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/po'
Making install in src
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/src'
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/src'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
/bin/bash ../libtool   --mode=install /usr/bin/install -c indicator-virtualbox '/usr/bin'
libtool: install: /usr/bin/install -c indicator-virtualbox /usr/bin/indicator-virtualbox
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/src'
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/src'
Making install in images
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images'
Making install in ubuntu-mono-dark
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[3]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/icons/ubuntu-mono-dark/apps/22" || /bin/mkdir -p "/usr/share/icons/ubuntu-mono-dark/apps/22"
/usr/bin/install -c -m 644 22/indicator-virtualbox.svg '/usr/share/icons/ubuntu-mono-dark/apps/22'
make  install-data-hook
make[4]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
make[4]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[3]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
Making install in ubuntu-mono-light
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[3]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/icons/ubuntu-mono-light/apps/22" || /bin/mkdir -p "/usr/share/icons/ubuntu-mono-light/apps/22"
/usr/bin/install -c -m 644 22/indicator-virtualbox.svg '/usr/share/icons/ubuntu-mono-light/apps/22'
make  install-data-hook
make[4]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
make[4]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[3]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images'
make[3]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images'
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images'
Making install in images/ubuntu-mono-dark
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/icons/ubuntu-mono-dark/apps/22" || /bin/mkdir -p "/usr/share/icons/ubuntu-mono-dark/apps/22"
/usr/bin/install -c -m 644 22/indicator-virtualbox.svg '/usr/share/icons/ubuntu-mono-dark/apps/22'
make  install-data-hook
make[3]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
make[3]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-dark'
Making install in images/ubuntu-mono-light
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/icons/ubuntu-mono-light/apps/22" || /bin/mkdir -p "/usr/share/icons/ubuntu-mono-light/apps/22"
/usr/bin/install -c -m 644 22/indicator-virtualbox.svg '/usr/share/icons/ubuntu-mono-light/apps/22'
make  install-data-hook
make[3]: Entering directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
make[3]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1/images/ubuntu-mono-light'
make[1]: Entering directory `/run/shm/indicator-virtualbox-1.1.1'
make[2]: Entering directory `/run/shm/indicator-virtualbox-1.1.1'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/applications" || /bin/mkdir -p "/usr/share/applications"
/usr/bin/install -c -m 644 indicator-virtualbox.desktop '/usr/share/applications'
test -z "/usr/share/pixmaps/" || /bin/mkdir -p "/usr/share/pixmaps/"
/usr/bin/install -c -m 644 images/indicator-virtualbox.png '/usr/share/pixmaps/'
test -z "/usr/share/indicator-virtualbox" || /bin/mkdir -p "/usr/share/indicator-virtualbox"
/usr/bin/install -c -m 644 images/indicator-virtualbox-about.png images/indicator-virtualbox.png '/usr/share/indicator-virtualbox'
make[2]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1'
make[1]: Leaving directory `/run/shm/indicator-virtualbox-1.1.1'

======================== Installation successful ==========================

Copying documentation directory...
./
./TODO
./README
./NEWS
./INSTALL
./ChangeLog
./COPYING
./AUTHORS

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting temp dir...OK


**********************************************************************

Done. The new package has been installed and saved to

/dev/shm/indicator-virtualbox-1.1.1/indicator-virtualbox_1.1.1-1_amd64.deb

You can remove it from your system anytime using: 

dpkg -r indicator-virtualbox

**********************************************************************

# 使用 checkinstall 安裝後可在目錄下找到打包完成的 deb。


3.7. 恭喜您,現在可以使用 indicator-virtualbox 了。

啟動 indicator-virtualbox。


4. 加入開機自動啟動

4.1. 複製設定檔至始動應用程式 (autostart) 裡。
[ jonny@precise ~ ]
$ cp /usr/share/applications/indicator-virtualbox.desktop ~/.config/autostart/ [Enter]

已新增至始動應用程式。

4.2. 若您不想開機時馬上啟動,可補上 X-GNOME-Autostart-Delay 參數,這裡以逾時 30 秒為例。
[ jonny@precise ~ ]
$ vim /home/jonny/.config/autostart/indicator-virtualbox.desktop [Enter]
 1 [Desktop Entry]
 2 Name=Indicator for Virtualbox
 3 Name[ru]=Индикатор для virtualbox
 4 Name[uk]=Індикатор для virtualbox
 5 GenericName=Indicator for Virtualbox
 6 GenericName[ru]=Индикатор для virtualbox
 7 GenericName[uk]=Індикатор для virtualbox
 8 Comment=Indicator for Virtualbox
 9 Comment[ru]=Индикатор для virtualbox
10 Comment[uk]=Індикатор для virtualbox
11 Exec=indicator-virtualbox
12 Icon=indicator-virtualbox
13 StartupNotify=true
14 Terminal=false
15 Type=Application
16 Categories=System;
17 X-GNOME-Autostart-Delay=30

# [1] 這裡只提供 Ubuntu 12.04 amd64 的 deb。

# 本文同步發佈於 自由軟體鑄造場 (OpenFoundry)

延伸閱讀:
好用的製作 deb 工具 – checkinstall « stephon's blog

相關連結:
indicator-virtualbox in Launchpad
Template “indicator-virtualbox” : Translations : Series 1.1 : indicator-virtualbox
Indicator-VirtualBox: Launch Virtual Machines Without Opening VirtualBox [AppIndicator] ~ Web Upd8 # for Ubuntu 10.04, 10.10 and 11.04

留言

張貼留言

喜歡這篇文章嗎?歡迎在底下留言讓凍仁知道。😉

Popular Articles

MySQL 語法匯整