2010年2月19日

在ubuntu 將 virtualbox 裡網路設定靜態 IP

來源: http://waue0920.blogspot.com/2008/10/ubuntu-virtualbox.html
參考: https://help.ubuntu.com/community/VirtualBox#Networking
若要在virtualbox內的主機,設定為靜態或動態ip的上網模式, 我的router為 192.168.138.254,我ubuntu的主機網路位址為192.168.138.191,而在主機內的虛擬機器用dhcp的方式上網是完全沒有問題,但是想讓虛擬機器用同樣為192.168.138.xxx 的網址就需要額外設定了。
sudo apt-get install bridge-utils
sudo gedit /etc/network/interfaces
修改以下內容
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.138.191
netmask 255.255.255.0
gateway 192.168.138.254
bridge_ports eth0 vbox0
auto lo
iface lo inet loopback
然後
sudo /etc/init.d/networking restart
sudo gedit /etc/vbox/interfaces
修改以下內容
# Each line should be of the format :
#
vbox0 waue br0
sudo /etc/init.d/vboxnet restart
sudo chown root:vboxusers /dev/net/tun
sudo chmod g+rw /dev/net/tun
gedit /etc/udev/rules.d/20-names.rules
將以下
KERNEL=="tun", NAME="net/%k"
改成
KERNEL=="tun", NAME="net/%k", GROUP="vboxusers", MODE="0660"
開啟virtualbox -> 設定值->網路->
附掛到:"主端介面"
介面名稱:"vbox0"

之後,開啟虛擬主機進入其作業系統之後,就可以設定其為靜態ip囉

compile gretl in ubuntu Karmic 9.10

先建一個子目錄, 例如 cvs,
進入後,  先下指令, 抓原始碼

cvs -d:pserver:anonymous@gretl.cvs.sourceforge.net:/cvsroot/gretl login
問密碼不用輸入, 直接按 [enter],
再輸入
cvs -z3 -d:pserver:anonymous@gretl.cvs.sourceforge.net:/cvsroot/gretl co -P gretl
如此會產生 ./cvs/gretl 子目錄, 以後更新原始碼時, 下指令
cvs update -d -P
就會自動更新了

在 ./configure 之後, 如果少了 zlib, 則需安裝
libzip-dev

2010年2月13日

grub2 的直接從 iso 檔開機功能 (boot from iso)

menuentry "Ubuntu Live 9.04 32bit" {
loopback loop /boot/isos/ubuntu9.04.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/isos/ubuntu9.04.iso --
initrd (loop)/casper/initrd.gz
}
menuentry "Ubuntu 8.10" {
set isofile="/boot/isos/ubuntu.iso"
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt --
initrd (loop)/casper/initrd.lz
}

2010年2月5日

遠端控制你的 ubuntu - vino, xrdp, ssh

1. 在 ubuntu 工作列 系統 -> 偏好設定 -> 遠端桌面 設定後, 即可利用 vnc 協定來連線
    在 client 端, 若是 ubuntu, 可用預裝的 網際網路-》遠端桌面檢視器
2. 如果習慣用終端伺服器用戶端 (連 windows 用的), 則要加裝 vnc4viewer, 或  xrdp
3. 用文字 ssh 介面登入的人,可以安裝 ssh server

用 vnc 連的缺點是一定要使用者在本地端登入了,才可檢視桌面, 旦重開機而無預設帳號登入,則無法使用VNCViewer檢視, 此時可改用 XDMCP

在終端伺服器用戶端下, XDMCP 預設是不能選的, 因為還要加安裝 xnest:
sudo apt-get install xnest

2010年2月4日

主機裝 virtualBox 2.0.4 OSE, 在 client 端中裝 Ubuntu 9.04, 螢幕解析度設定

參考: http://ok2.tw/blog/100
將以下 edit /etc/X11/xorg.conf 檔之內容改成以下, 即可用 1024x768 模式
Section "Device"
Identifier "VESA Framebuffer"
Driver "vesa"
#VideoRam 4096
# Insert Clocks lines here if appropriate
EndSection
Section "Monitor"
Identifier "My Monitor"
HorizSync 31.5 - 150.0
VertRefresh 75-85
EndSection
Section "Screen"
Identifier "Screen 1"
Device "VESA Framebuffer"
Monitor "My Monitor"
# If your card can handle it, a higher default color depth (like 24 or 32)
# is highly recommended.
# DefaultDepth 8
# DefaultDepth 16
DefaultDepth 24
# DefaultDepth 32
# "1024x768" is also a conservative usable default resolution. If you
# have a better monitor, feel free to try resolutions such as
# "1152x864", "1280x1024", "1600x1200", and "1800x1400" (or whatever your
# card/monitor can produce)
Subsection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 32
Modes "1024x768" "800x600" "640x480"
EndSubsection
EndSection
Section "ServerLayout"
# The Identifier line must be present
Identifier "Simple Layout"
# Each Screen line specifies a Screen section name, and optionally
# the relative position of other screens. The four names after
# primary screen name are the screens to the top, bottom, left and right
# of the primary screen. In this example, screen 2 is located to the
# right of screen 1.
Screen "Screen 1"
EndSection

2010年2月1日

安裝 Acrobat Reader 在 Ubuntu 9.10 (karmic koala) AMD64

到這裡抓

http://archive.canonical.com/ubuntu/pool/partner/a/acroread/

或設套件來源
deb http://archive.canonical.com/ubuntu karmic partner

然後
sudo apt-get update
sudo apt-get install acroread

在 ubuntu 9.10 (AMD64) 裝 自行打包的 gretl 1.8.7 with aptitude

gretl-1.8.7 for ubuntu 9.10 (AMD64)
This deb file can be installed successfully on ubuntu 9.10 (Karmic) AMD64. But some actions should be done before gretl works.
1. Installing this deb on ubuntu 9.10 (AMD64) should have no problem.
2. After installing the deb, copy /usr/local/bin/libgrel*.* to /usr/bin (with sudo)
3. Install liblapack-dev with "sudo aptitude install liblapack-dev" 
    This is because synaptic and apt-get don't work for solving dependences issue.
OK, it is now to run gretl.

gretl_1.8.6-1_amd64.deb 這個是我在 ubutnu 8.10 AMD64 版本打包的, 還沒在其它電腦試過
安裝後發現
1. /usr/local/bin/gretl_x11: error while loading shared libraries: libgretl-1.0.so.0:
同上將 /usr/local/lib 下, libgretl-1.0.so.0 等 4 個以 libgretl* 開頭的檔, 全部複製到 /usr/lib

2. 發現有嚴重的 dependences 問題, google 後, 有人建議用 aptitude, 它會提出降級解決方案, 如下

xxx@xxx-desktop:~$ sudo aptitude install liblapack-dev
正在讀取套件清單... 完成
正在重建相依關係         
正在讀取狀態資料... 完成
初始化套件狀態... 完成    
正在編輯延伸狀態訊息... 完成
以下的套件狀態為毀斷
  libgfortran3
以下新套件將會安裝:
  libatlas-base-dev{a} libatlas-headers{a} libatlas3gf-base{a}
  libblas-dev{a} libblas3gf{a} liblapack-dev liblapack3gf{a}
0 個套件升級, 8 個新安裝, 0 個將移除且 0 個不會升級.
需要下載 22.9MB 的歸檔檔案. 解裝後將用去 91.3MB.
以下套件含有相依性:
  libgfortran3: 相依關係: gcc-4.4-base (= 4.4.1-4ubuntu8) 但 4.4.1-4ubuntu9 已安裝
以下動作會解決這些相依問題:

降級 下列套件:
cpp-4.4 [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]
gcc-4.4 [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]
gcc-4.4-base [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]
lib32gcc1 [1:4.4.1-4ubuntu9 (now) -> 1:4.4.1-4ubuntu8 (karmic)]
lib32stdc++6 [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]
libgcc1 [1:4.4.1-4ubuntu9 (now) -> 1:4.4.1-4ubuntu8 (karmic)]
libgomp1 [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]
libstdc++6 [4.4.1-4ubuntu9 (now) -> 4.4.1-4ubuntu8 (karmic)]

分數是 172

是否接受該解決方案?[Y/n/q/?] y


執行完畢後, 就可以正常跑了!