安装debian手记
1:安装linux发行版,怎样安装不描述,但是必选项为ssh服务器端,如果安装包中没有该服务器端,
安装完成后上网搜ssh服务器端在安装的发行版中的安装方法并进行安装
2:安装编译环境,安装必备工具集
apt-get install build-essential vim ctags subversion x11-utils nvi flex bison
其中
x11-utils(包含luit)
3:安装virtualbox增强插件
3.1 挂载光驱
mkdir /mnt/cdrom
mount -t auto -r ro /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
sh VBoxLinuxAdditions.run install
重启虚拟机
4:将放有所需文件的盘自动挂载到虚拟机
这里是D盘,挂载共享名称为D
手动挂载一次,验证virtualbox增强插件安装成功
mkdir /mnt/D
mount -t vboxsf D /mnt/D
cd /mnt/D
检查文件夹下的挂载情况,如有异常,检查3的操作,上网找解决方案
5:自动挂载windows文件系统
方法一(debian下无效)
修改/etc/fstab为虚拟机启动后自动挂载windows的文件夹到虚拟机
在文件最后增加以下一行
D /mnt/D vboxsf rw,gid=100,uid=1000,auto 0 0
方法二:
你需要在 "/etc/rc.local" 里写入相应的脚本:
/bin/mount -t vboxsf D /mnt/D
6:重建home目录映像
ln -s /mnt/D /home/hugo/d
ln -s /home/hugo/d/unix_system/.bashrc /home/hugo/.bashrc
ln -s /home/hugo/d/note /home/hugo/note
ln -s /home/hugo/d/not_in_svn /home/hugo/not_in_svn
ln -s /home/hugo/d/private /home/hugo/private
ln -s /home/hugo/d/remote_connect /home/hugo/remote_connect
ln -s /home/hugo/d/src /home/hugo/src
ln -s /home/hugo/d/tag /home/hugo/tag
ln -s /home/hugo/d/tools /home/hugo/tools
ln -s /home/hugo/d/unix_system/.vim /home/hugo/.vim
ln -s /home/hugo/d/unix_system/.vimrc /home/hugo/.vimrc
ln -s /home/hugo/d/work /home/hugo/work
7:建立sshd网络连接
7.1网卡1 选择 网络地址转换(NAT)
7.2网卡2 选择 仅主机(Host-Only)适配器
7.3配置/etc/network/interfaces,新增eth1作为固定ip供本地连接,eth0使用动态ip,用于访问主机的网络
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
#eth1
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
broadcast 192.168.56.255
8:secureCRT中配置192.168.56.101的连接
连接中的字符编码为UTF-8
9:为putty建立192.168.56.101连接 (非必需,有secureCRT一般足够,装逼使用)
9.1 使用putty客户端提供的puttygen工具制作秘钥文件debian.ppk, 不用填写密码,保存为私钥
9.2 在/home/hugo/.ssh下创建文件authorized_keys,将puttygen中生产私钥时对应的公钥复制填写到该文件中
9.3 创建putty快捷方式,填写内容如下
"D:\Program Files\puttyfile_0.62cn\putty.exe" -i "D:\Program Files\puttyfile_0.62cn\debian.ppk" hugo@192.168.56.101
10:修改ssh配置,优化连接
在/etc/ssh/sshd_config中加入以下一行
UseDNS no
11:配置root用户的配置文件(非关键,根据需要使用)
这步不建议使用软链接,直接cp文件
cp /home/hugo/.bashrc .
cp /home/hugo/.vimrc .
cp -R /home/hugo/d/unix_system/.vim .
以下步骤为个人所需
12.安装apue库
[hugo@debian ~/src/apue/apue.lib/src]
$ make clean ; make
$ su -
root@debian:/mnt/D/src/apue/apue.lib/src # make install
13.字典
root# apt-get install sdcv
mkdir .stardict
ln -s /home/hugo/d/unix_system/dict ~/.stardict/dic
cd ~/.stardict/dic
find . -name "*bz2" -exec tar -xjvf {} \;