星期日, 6月 29, 2008

轉載:用 chroot 在 Debian 4.0 中啟動 b2d


分類:Linux 記事

2007/11/12 22:37


Debian 參考手冊第八章中(8.6.35) 提到可以用 chroot 來執行不同版本的 Debian, 今日心情特別好, 就來試看看囉!正好硬碟中 /dev/hda2 是之前用的Sarge版本(b2d) root directory, 我的 Debian 4.0 則是裝在 /dev/hda7, 所以就不必用 debootstrap 來建構另一個系統, 就由現成的架構來試一試, 結果真的成功了, 這一篇文章就是由 Debian 4.0 開機進入 X-window 後再以 chroot 操作 b2d 的 X-window 來完成的, 真是美好的經驗啊!


另外參考網頁:摩托學園討論區:建構 Debian 子系統 (sarge)


詳細內容請詳閱: http://tw.myblog.yahoo.com/jw!_fUl7X2LFR_349O8abd7YXF9nQ--/article?mid=160&prev=174&next=159

如何變更時區 (Ubuntu)


  1. Logged in as root, check which timezone your machine is currently using by executing `date`. You'll see something like Mon 17 Jan 2005 12:15:08 PM PST, PST in this case is the current timezone.

  2. Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory.

  3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as

    mv /etc/localtime /etc/localtime-old

  4. Create a symbolic link from the appropiate timezone to /etc/localtime. Example:

    ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime

  5. If you have the utility rdate, update the current system time by executing

    ntpdate -s time.stdtime.gov.tw

    or

    ntpdate -s time.nist.gov


  6. Set the hardware clock by executing:

    hwclock --date --set

FreeBSD UTF-8化

轉載 http://blog.ychsiao.org/2008/03/02/400


由於平時都用 putty 來管理 freebsd,所以有時會需要輸入中文,把設定記下來,下次才不會又找半天!!

星期四, 6月 19, 2008

[Ubuntu] 安裝 VMware Server 2.0 beta

Install VMware Server 2.0 Beta on Ubuntu 7.10 “Gutsy” : Ubuntu Tutorials : Dapper - Feisty - Gutsy - Hardy

雖然是針對 Ubuntu 7.10,不過,也適用 8.04的版本。
How to install VMware Server 2.0 Beta in Ubuntu 7.10 “Gutsy Gibbon”

1. Download VMware Server 2.0 Beta available from the VMware website. Write down the serial number it generates for you at registration.
(下載 VMware Server 2.0 Beta,並且把序號存檔)
2. Unpack this archive to a location on your machine (perhaps /tmp).
(解壓縮 vmware server 2.0 beta)
3. Before you configure and compile VMware Server we need to disable ipv6 support in Ubuntu as it is not currently compatible.
(關閉 IPv6 協定)
4. sudo aptitude install build-essential xinetd
(安裝 build-essential 及 xinetd 兩個套件)
5. cd /tmp/vmware-server-distrib ; sudo ./vmware-install.pl
(進入 vmware 解壓縮後的目錄,執行安裝)
6. Answer the questions presented during the installation. The defaults should be safe in most cases.
7. Because Ubuntu does not use the root user account we also need to setup access for your main user. Replace root with your username on line 10 of: /etc/vmware/hostd/authorization.xml (ACEDataUser).
(將 /etc/vmware/hostd/authorization.xml 第8行的 root 改成 ubuntu 登入的帳號)

8. At this point I had to restart my machine to put the changes in place. I did try restarting the service(s) after changing the config, but it still didn’t allow access.
(重新啟動電腦)
9. Access your VMware Server via http://localhost:8222 or https://localhost:8333
(用瀏覽器存取 VMware Server )
10. Accessing the remote console tab to view your virtual machine will also require an extension installed to Firefox. This also requires a browser restart after the extension is installed.
(用 Firefox或 IE 都可以順利執行,不過,利用Galeon 時卻因為無法安裝套件而無法順操作 VMware)

星期三, 6月 18, 2008

星期二, 6月 17, 2008

設定 VirtualBox 網卡為 Host

上網找了一下,在 https://help.ubuntu.com/community/VirtualBox 裡發現相關的作法,記錄下來,以免下次忘記。


VirtualBox - Community Ubuntu Documentation
Networking

To start, NAT is by far the easiest way to get your guests connected to the interweb, but you may want to use the guests as servers, for this you need Host Networking. You will need to install bridge-utils and uml-utilities so that you can make a tap device and add it to a bridge.

sudo apt-get install bridge-utils uml-utilities

Now make a bridge, and put your current interface into it:

sudo tunctl -t tap1 -u fred #請將 fred 改為可以執行 VirtualBox 的帳號
sudo chown root.vboxusers /dev/net/tun
sudo chmod g+rw /dev/net/tun


Set the permission to persist across reboots, by editing as root /etc/udev/rules.d/20-names.rules and changing:

KERNEL=="tun", NAME="net/%k"

to

KERNEL=="tun", NAME="net/%k", GROUP="vboxusers", MODE="0660"

Make a new bridge called br0:

sudo brctl addbr br0

Put your current interface (in this case eth0) into promiscuous mode, then add it to the bridge and give the bridge a dhcp address.

sudo ifconfig eth0 0.0.0.0 promisc
sudo brctl addif br0 eth0


If you are using DHCP to automatically get an IP address, set the bridge to use DHCP.

sudo dhclient br0

If you are using a static IP, specify the IP address, netmask and add the default gateway route

#Where 192.168.1.105 is your static IP and 255.255.0.0 is your netmask
sudo ifconfig br0 192.168.1.105 netmask 255.255.0.0

#Where 192.168.1.1 is your default gateway
sudo route add default gw 192.168.1.1 br0

Add the new tap1 device to the bridge and activate tap1 (the second line appears to be necessary according to [WWW] http://ubuntuforums.org/showthread.php?t=561461#3)

sudo brctl addif br0 tap1
sudo ifconfig tap1 up