Ubuntudesktop14.04.2安装过程

Ubuntudesktop14.04.2安装过程

时间:  2015-02-28 21:37
作者:  lsgxeva
分类:  工作学习>>linux>>server
摘要:  用vmware安装Ubuntudesktop14.04.2系统
标签:  linux ubuntu 安装 vmware
提示:  文章均来自网络,版权为原作者所有,如有侵犯权益,请联络我们.



一:安装ubuntu server系统

1: 选择显示语言 >> English >> install ubuntu


2: 安装该系统时更新系统并安装音频解码软件


3: 磁盘分区方式 使用并擦除整个硬盘并使用LVM分区的方式




4: 选择地区为中国上海


5:  选择键盘类型 >> English(US)


6: 设置用户信息


7: 系统安装完成




二:配置ubuntu系统

sudo 与 su 的区别

sudo passwd root        设置root密码
sudo passwd -l root     锁定root用户
sudo passwd -u root     解锁root用户
sudo -s -h              终端机模式下切换到root身份
sudo su                 切换到root用户
su -l root              切换到root用户

sudo --help   sudo -h
显示sudo命令的帮助信息
 
su --help su -h
显示su命令的帮助信息

执行sudo命令 不需要知道root的密码
执行su -l root命令 必须输入root的密码

lsgx@UbuntuServer:~$  sudo passwd root      //  设置root的密码
[sudo] password for lsgx: // lsgx的密码
Enter new UNIX password:  // 设置root的密码
Retype new UNIX password:  // 确认root的密码
passwd: password updated successfully

lsgx@UbuntuServer:~$  su -l root
Password:  //  root的密码
root@UbuntuServer:~#  vi ~/.bashrc 
--------------------------------------------------------------
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi
---------------------------------------------------------------
root@UbuntuServer:~#  exit
logout


普通用户获取sudo特权

方法一:将用户添加到sudo组,从而可以使用sudo命令。
将用户添加到sudo组为主用户组(初始群组)
root@UbuntuServer:~#  usermod -a -G sudo root
root@UbuntuServer:~#  usermod -a -G sudo lsgx

将用户添加到sudo组为有效群组(次要群组)
root@UbuntuServer:~#  gpasswd -a root sudo 
Adding user root to group sudo
root@UbuntuServer:~#  gpasswd -a lsgx sudo 
Adding user lsgx to group sudo

方法二:直接修改sudoers配置文件
$  su -l root        // 切换到root用户状态 输入root用户的密码
#  vi /etc/sudoers       //  修改 /etc/sudoers 文件

找到下面这些信息
# User privilege specification
root    ALL=(ALL) ALL
在这些信息的后面一行添加
lsgx  ALL=(ALL) ALL
这里的lsgx是你要获得sudo权限的用户名
修改完成后 保存文件
 
此时lsgx这个普通帐户就已经具有sudo特权



配置 source.list 文件

lsgx@UbuntuServer:~$   sudo  apt-get install aptitude
lsgx@UbuntuServer:~$   sudo  aptitude install opehssh-server
lsgx@UbuntuServer:~$   sudo  cp /etc/apt/sources.list /etc/apt/sources.list.bak
lsgx@UbuntuServer:~$   sudo  vi /etc/apt/sources.list
-------------------------------------------------------------
#

## mirrors.163.com
#deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

## mirrors.aliyun.com
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse



#deb cdrom:[Ubuntu 14.04.2 LTS _Trusty Tahr_ - Release amd64 (20150218.1)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty universe
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

---------------------------------------------------------------

lsgx@UbuntuServer:~$   sudo  aptitude update 

FAQ:
F1: 
W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
Q1:
lsgx@UbuntuServer:~$   sudo  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192

lsgx@UbuntuServer:~$   sudo  aptitude update 
lsgx@UbuntuServer:~$  sudo aptitude dist-upgrade


$ apt-get -h
apt 1.0.1ubuntu2,用于 amd64 构架,编译于 Apr 29 2015 13:36:50
Usage: apt-get [options] command
       apt-get [options] install|remove pkg1 [pkg2 ...]
       apt-get [options] source pkg1 [pkg2 ...]

apt-get is a simple command line interface for downloading and
installing packages. The most frequently used commands are update
and install.

Commands:
   update - Retrieve new lists of packages   ——在修改/etc/apt/sources.list或者/etc/apt/preferences之后运行该命令。此外您需要定期运行这一命令以确保您的软件包列表是最新的。
   upgrade - Perform an upgrade   ——更新所有已安装的软件包
   install - Install new packages (pkg is libc6 not libc6.deb)   ——安装一个新软件包(参见下文的aptitude)
   remove - Remove packages   ——卸载一个已安装的软件包(保留配置文件)
   autoremove - Remove automatically all unused packages    ——自动 删除所有未使用的包 (保留配置文件)
   purge - Remove packages and config files   ——卸载一个已安装的软件包(删除配置文件)
   source - Download source archives   —— 下载该包的源代码
   build-dep - Configure build-dependencies for source packages    —— 配置源程序包的依赖关系
   dist-upgrade - Distribution upgrade, see apt-get(8)   ——智能 升级系统
   dselect-upgrade - Follow dselect selections    —— 使用 dselect  智能 升级系统
   clean - Erase downloaded archive files    —— 这个命令会把安装的软件的备份也删除,不过这样不会影响软件的使用的。
   autoclean - Erase old downloaded archive files    ——APT 会把已装或已卸的软件都备份在硬盘上,所以如果需要空间的话,可以让这个命令来删除你已经删掉的软件
   check - Verify that there are no broken dependencies    —— 检查是否有损坏的依赖
   changelog - Download and display the changelog for the given package   ——下载并显示给定软件包的更新日志
   download - Download the binary package into the current directory    ——下载这个二进制包到当前目录

Options:
  -h  This help text.      —— 此帮助文本。
  -q  Loggable output - no progress indicator     —— 输出日志-没有进度指示器
  -qq No output except for errors     —— 没有输出除了错误
  -d  Download only - do NOT install or unpack archives      ——只下载不安装或解压文件
  -s  No-act. Perform ordering simulation      ——没有行为。执行顺序仿真
  -y  Assume Yes to all queries and do not prompt      ——假定对所有的查询都不提示
  -f  Attempt to correct a system with broken dependencies in place     ——试图纠正一个打破依赖关系的系统
  -m  Attempt to continue if archives are unlocatable      ——我试图继续, 如果档案是非稳定的文件。
  -u  Show a list of upgraded packages as well      ——显示升级包的列表
  -b  Build the source package after fetching it      ——在获取源码后生成构建包
  -V  Show verbose version numbers     ——显示详细的版本号
  -c=? Read this configuration file      ——读取此配置文件
  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp      ——设置一个任意的配置选项,例如   -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual     ——参考其他命令
pages for more information and options.     ——获取更多消息和设置信息

apt-cache search package 搜索包
apt-cache show package 获取包的相关信息,如说明、大小、版本等
sudo apt-get install package 安装包
sudo apt-get install package - - reinstall 重新安装包
sudo apt-get -f install 修复安装"-f = ——fix-missing"
sudo apt-get remove package 删除包
sudo apt-get remove package - - purge 删除包,包括删除配置文件等
sudo apt-get update 更新源
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo apt-get dselect-upgrade 使用 dselect 升级
apt-cache depends package 了解使用依赖
apt-cache rdepends package 是查看该包被哪些包依赖
sudo apt-get build-dep package 安装相关的编译环境
apt-get source package 下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean 清理无用的包
sudo apt-get check 检查是否有损坏的依赖


$ aptitude -h
aptitude 0.6.8.2
用法: aptitude [-S 文件名] [-u|-i]
       aptitude [选项] <动作> ...
  动作 (如果未指定,aptitude 将进入交互模式):

 install      - 安装/升级软件包。
 remove       - 卸载软件包。
 purge        - 卸载软件包并删除其配置文件。
 hold         - 将软件包置于保持状态。
 unhold       - 取消对一个软件包的保持命令。
 markauto     - 将软件包标记为已经自动安装。
 unmarkauto   - 将软件包标记为已经手动安装。
 forbid-version - 禁止 aptitude 升级到某一特定版本的软件包。
 update       - 下载新/可升级软件包列表。
 safe-upgrade - 执行一次安全的升级。
 full-upgrade - 执行升级,可能会安装和卸载软件包。
 build-dep    - 安装软件包的编译依赖。
 forget-new   - 忘记哪些软件包是“新”的。
 search       - 按名称 和/或 表达式搜索软件包。
 show       - 显示一个软件包的详细信息。
 versions     - Displays the versions of specified packages.
 clean        - 删除已下载的软件包文件。
 autoclean    - 删除旧的已下载软件包文件。
 changelog    - 查看一个软件包的变更日志。
 download     - 下载软件包的 .deb 文件。
 reinstall    - 下载并(可能)重新安装一个现在已经安装了的软件包。
 why          - Show the manually installed packages that require a package, or
                why one or more packages would require the given package.
 why-not     - 显示导致与给定软件包包冲突的手动安装的包,或者为什么
                 如果安装一个或多个软件包会导致与给定软件包冲突。

  选项:
 -h             此帮助文本。
 --no-gui       即使可用,也不使用 GTK 图形用户界面。
 -s             模拟动作,但是并不真正执行。
 -d             仅仅下载软件包,不安装或者卸载任何东西。
 -P             Always prompt for confirmation of actions.    —— 总是提示确认行动。
 -y             假设对简单的 yes/no 问题回答“yes”。
 -F 格式        指定显示搜索结果的格式;参见手册。
 -O 次序        指定如何排列显示搜索结果;参见手册。
 -w 宽度        指定显示搜索结果的格式宽度。
 -f             积极地尝试修复损坏的软件包。
 -V             显示就要安装的软件包版本。
 -D             显示自动改变的软件包的依赖关系
 -Z     显示每个软件包的安装尺寸的变化。
 -v             显示附加信息。(可能会提供多次)。
 -t [release]   设置将要从中安装软件包的发布版本。
 -q            在命令行状态下,不显示增量进度指示器
 -o key=val     直接设置名为“key”的配置选项。
 --with(out)-recommends Specify whether or not to treat recommends as
                strong dependencies.     —— 指定是否尝试纠正为强依赖性。
 -S fname       从文件名中读取 aptitude 的扩展状态信息。
 -u             开始运行时下载新的软件包列表。
                  (terminal interface only)
 -i             开始运行时执行安装。
                  (terminal interface only)


现在已经推荐用aptitude取代apt-get了。
我用apt安装软件,可以用aptitude卸载不?
可以,aptitude同时会卸载依赖的包,apt只卸载你命令里的包,就这点区别。
aptitude是有洁癖的人的最爱。


安装软件命令的常见用法:
下面将要介绍的所有命令都需要sudo!使用时请将“packagename”和“string”替换成您想要安装或者查找的程序。
apt-get update ——在修改/etc/apt/sources.list或者/etc/apt/preferences之后运行该命令。此外您需要定期运行这一命令以确保您的软件包列表是最新的。
apt-get install packagename ——安装一个新软件包(参见下文的aptitude)
apt-get remove packagename ——卸载一个已安装的软件包(保留配置文件)
apt-get --purge remove packagename ——卸载一个已安装的软件包(删除配置文件)
dpkg --force-all --purge packagename  —— 有些软件很难卸载,而且还阻止了别的软件的应用,就可以用这个,不过有点冒险。
apt-get autoclean  —— apt会把已装或已卸的软件都备份在硬盘上,所以如果需要空间的话,可以让这个命令来删除你已经删掉的软件
apt-get clean  —— 这个命令会把安装的软件的备份也删除,不过这样不会影响软件的使用的。
apt-get upgrade ——更新所有已安装的软件包
apt-get dist-upgrade ——将系统升级到新版本
apt-cache search string ——在软件包列表中搜索字符串
dpkg -l package-name-pattern ——列出所有与模式相匹配的软件包。如果您不知道软件包的全名,您可以使用“*package-name-pattern*”。
aptitude ——详细查看已安装或可用的软件包。
    与apt-get类似,aptitude可以通过命令行方式调用,但仅限于某些命令——最常见的有安装和卸载命令。由于aptitude比apt-get了解更多信息,可以说它更适合用来进行安装和卸载。
apt-cache showpkg pkgs ——显示软件包信息。
apt-cache dumpavail ——打印可用软件包列表。
apt-cache show pkgs ——显示软件包记录,类似于dpkg –print-avail。
apt-cache pkgnames ——打印软件包列表中所有软件包的名称。
dpkg -S file ——这个文件属于哪个已安装软件包。
dpkg -L package ——列出软件包中的所有文件。
apt-file search filename ——查找包含特定文件的软件包(不一定是已安装的),这些文件的文件名中含有指定的字符串。
    apt-file是一个独立的软件包。您必须 先使用apt-get install来安装它,然后运行apt-file update。如果apt-file search filename输出的内容太多,您可以尝试使用apt-file search filename | grep -w filename(只显示指定字符串作为完整的单词出现在其中的那些文件名)或者类似方法,例如:apt-file search filename | grep /bin/(只显示位于诸如/bin或/usr/bin这些文件夹中的文件,如果您要查找的是某个特定的执行文件的话,这样做是有帮助的)。
apt-get autoclean——定期运行这个命令来清除那些已经卸载的软件包的.deb文件。通过这种方式,您可以释放大量的磁盘空间。如果您的需求十分迫切,可 以使用apt-get clean以释放更多空间。这个命令会将已安装软件包裹的.deb文件一并删除。大多数情况下您不会再用到这些.debs文件,因此如果您为磁盘空间不足 而感到焦头烂额,这个办法也许值得一试。
deborphan和debfoster工具可以找出已经安装在系统上的不会被用到的软件包。



虚拟机拍摄快照 >> start
1: 设置root密码, 切换至root用户
2: 设置源, 更新源


安装VMwareTools
lsgx@UbuntuServer:~$  sudo aptitude install openssh-server
lsgx@UbuntuServer:~$  sudo aptitude install vim
lsgx@UbuntuServer:~$  sudo aptitude install exuberant-ctags 
lsgx@UbuntuServer:~$   sudo aptitude install emacs
lsgx@UbuntuServer:~$  sudo aptitude install bash
lsgx@UbuntuServer:~$   sudo aptitude install tree
lsgx@UbuntuServer:~$  sudo aptitude install build-essential
lsgx@UbuntuServer:~$   sudo aptitude install gdb gdb-doc cgdb 
lsgx@UbuntuServer:~$  sudo aptitude install  autoconf   
lsgx@UbuntuServer:~$  sudo aptitude install dpkg-dev
lsgx@UbuntuServer:~$  sudo aptitude install p7zip-full
lsgx@UbuntuServer:~$  sudo aptitude install libncurses5-dev 
lsgx@UbuntuServer:~$  sudo aptitude install libiconv-hook-dev 
lsgx@UbuntuServer:~$  sudo aptitude install  kernel-package
lsgx@UbuntuServer:~$  sudo aptitude install linux-headers-`uname -r`
lsgx@UbuntuServer:~$  sudo aptitude install  fakeroot  
lsgx@UbuntuServer:~$  sudo aptitude install exfat-utils 
lsgx@UbuntuServer:~$  sudo aptitude install perl perl-doc
lsgx@UbuntuServer:~$  sudo aptitude install racket racket-common racket-common 
lsgx@UbuntuServer:~$  sudo aptitude install cmake cmake-curses-gui cmake-doc 
lsgx@UbuntuServer:~$  sudo aptitude install vsftpd
lsgx@UbuntuServer:~$  sudo aptitude install valgrind valgrind-dbg
lsgx@UbuntuServer:~$  sudo aptitude install psmisc 
lsgx@UbuntuServer:~$  sudo aptitude install v86d
lsgx@UbuntuServer:~$  sudo aptitude install lshw
lsgx@UbuntuServer:~$  sudo aptitude install smartmontools 
lsgx@UbuntuServer:~$  sudo aptitude install dmidecode 
lsgx@UbuntuServer:~$   sudo aptitude install samba samba-common samba-common-bin smbclient smbnetfs
lsgx@UbuntuServer:~$  sudo aptitude install nfs-kernel-server nfs-common 


1. VM菜单->VMware Tools Install
2. 挂载光驱(注意光驱所对应的设备名)
lsgx@UbuntuServer:~/work/vmtools$  df -h
Filesystem                         Size  Used Avail Use% Mounted on
/dev/mapper/UbuntuServer--vg-root   58G  2.2G   53G   4% /
none                               4.0K     0  4.0K   0% /sys/fs/cgroup
udev                               483M  4.0K  483M   1% /dev
tmpfs                               99M  1.1M   98M   2% /run
none                               5.0M     0  5.0M   0% /run/lock
none                               494M     0  494M   0% /run/shm
none                               100M     0  100M   0% /run/user
/dev/sda1                          236M   68M  156M  31% /boot
lsgx@UbuntuServer:~/work/vmtools$  ls -alh /dev/ | grep cdrom
lrwxrwxrwx  1 root root           3 Apr  9 15:09 cdrom -> sr0
crw-rw----  1 root cdrom    21,   0 Apr  9 14:39 sg0
brw-rw----  1 root cdrom    11,   0 Apr  9 15:09 sr0
lsgx@UbuntuServer:~/work/vmtools$  sudo mount -t iso9660 -r /dev/cdrom /media/cdrom/
lsgx@UbuntuServer:~/work/vmtools$  ls -a /media/cdrom/
.   manifest.txt     VMwareTools-9.6.2-1688356.tar.gz  vmware-tools-upgrader-64
..  run_upgrader.sh  vmware-tools-upgrader-32
lsgx@UbuntuServer:~/work/vmtools$  cp /media/cdrom/VMwareTools-9.6.2-1688356.tar.gz ~/work/vmtools/
lsgx@UbuntuServer:~/work/vmtools$  sudo umount /media/cdrom 
lsgx@UbuntuServer:~/work/vmtools$  ls -a /media/cdrom/
.  ..
lsgx@UbuntuServer:~/work/vmtools$  tar -zxvf ~/work/vmtools/VMwareTools-9.6.2-1688356.tar.gz -C ~/work/vmtools/vmware-tools-distrib/
lsgx@UbuntuServer:~/work/vmtools$  ls -a ~/work/vmtools/vmware-tools-distrib/
.  ..  bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
lsgx@UbuntuServer:~/work/vmtools$  cd ~/work/vmtools/vmware-tools-distrib/
lsgx@UbuntuServer:~/work/vmtools/vmware-tools-distrib$  sudo ./vmware-install.pl 
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files? 
[/usr/bin] 

What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc] 

What is the directory that contains the init scripts? 
[/etc/init.d] 

In which directory do you want to install the daemon files? 
[/usr/sbin] 

In which directory do you want to install the library files? 
[/usr/lib/vmware-tools] 

The path "/usr/lib/vmware-tools" does not exist currently. This program is 
going to create it, including needed parent directories. Is this what you want?
[yes] 

In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools] 

The path "/usr/share/doc/vmware-tools" does not exist currently. This program 
is going to create it, including needed parent directories. Is this what you 
want? [yes] 

The installation of VMware Tools 9.6.2 build-1688356 for Linux completed 
successfully. You can decide to remove this software from your system at any 
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by 
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 
this program to invoke the command for you now? [yes] 

Initializing...


Making sure services for VMware Tools are stopped.



The module vmci has already been installed on this system by another installer 
or package and will not be modified by this installer.

The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vmxnet3 has already been installed on this system by another 
installer or package and will not be modified by this installer.

The module pvscsi has already been installed on this system by another 
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another 
installer or package and will not be modified by this installer.

The VMware Host-Guest Filesystem allows for shared folders between the host OS 
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
to enable this feature? [yes] 


Before you can compile modules, you need to have the following installed... 

make
gcc
kernel headers of the running kernel


Searching for GCC...
Detected GCC binary at "/usr/bin/gcc".
The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
Would you like to change it? [no] 

Searching for a valid kernel header path...
Detected the kernel headers at "/lib/modules/3.16.0-34-generic/build/include".
The path "/lib/modules/3.16.0-34-generic/build/include" appears to be a valid 
path to the 3.16.0-34-generic kernel headers.
Would you like to change it? [no] 

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-FXK2Rz/vmhgfs-only'
/usr/bin/make -C /lib/modules/3.16.0-34-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
 MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-34-generic'
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/backdoor.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/backdoorGcc64.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/bdhandler.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/cpName.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/cpNameLite.o
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/dentry.o
In file included from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfs.h:40:0,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfsProto.h:37,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/module.h:39,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/dentry.c:34:
/tmp/modconfig-FXK2Rz/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]
    #define DEPRECATED(_fix) do {} while (0)
 ^
In file included from include/linux/kernel.h:13:0,
                 from ./arch/x86/include/asm/percpu.h:44,
                 from ./arch/x86/include/asm/preempt.h:5,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/wait.h:8,
                 from include/linux/fs.h:6,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/./shared/compat_fs.h:22,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/dentry.c:28:
include/linux/printk.h:106:0: note: this is the location of the previous definition
 #define DEPRECATED "[Deprecated]: "
 ^
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/dir.o
In file included from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfs.h:40:0,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/request.h:38,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/transport.h:26,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/bdhandler.c:30:
/tmp/modconfig-FXK2Rz/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]
    #define DEPRECATED(_fix) do {} while (0)
 ^
In file included from include/linux/kernel.h:13:0,
                 from include/asm-generic/bug.h:13,
                 from ./arch/x86/include/asm/bug.h:35,
                 from include/linux/bug.h:4,
                 from include/linux/kref.h:18,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/request.h:32,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/transport.h:26,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/bdhandler.c:30:
include/linux/printk.h:106:0: note: this is the location of the previous definition
 #define DEPRECATED "[Deprecated]: "
 ^
  CC [M]  /tmp/modconfig-FXK2Rz/vmhgfs-only/file.o
In file included from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfs.h:40:0,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfsProto.h:37,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/dir.c:37:
/tmp/modconfig-FXK2Rz/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]
    #define DEPRECATED(_fix) do {} while (0)
 ^
In file included from include/linux/kernel.h:13:0,
                 from ./arch/x86/include/asm/percpu.h:44,
                 from ./arch/x86/include/asm/preempt.h:5,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/dir.c:29:
include/linux/printk.h:106:0: note: this is the location of the previous definition
 #define DEPRECATED "[Deprecated]: "
 ^
In file included from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfs.h:40:0,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/hgfsProto.h:37,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/file.c:42:
/tmp/modconfig-FXK2Rz/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]
    #define DEPRECATED(_fix) do {} while (0)
 ^
In file included from include/linux/kernel.h:13:0,
                 from ./arch/x86/include/asm/percpu.h:44,
                 from ./arch/x86/include/asm/preempt.h:5,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from /tmp/modconfig-FXK2Rz/vmhgfs-only/file.c:29:
include/linux/printk.h:106:0: note: this is the location of the previous definition
 #define DEPRECATED "[Deprecated]: "
 ^
/tmp/modconfig-FXK2Rz/vmhgfs-only/file.c: In function ‘HgfsAioRead’:
/tmp/modconfig-FXK2Rz/vmhgfs-only/file.c:791:4: error: implicit declaration of function ‘generic_file_aio_read’ [-Werror=implicit-function-declaration]
    result = generic_file_aio_read(iocb, iov, numSegs, offset);
    ^
/tmp/modconfig-FXK2Rz/vmhgfs-only/file.c: In function ‘HgfsAioWrite’:
/tmp/modconfig-FXK2Rz/vmhgfs-only/file.c:863:4: error: implicit declaration of function ‘generic_file_aio_write’ [-Werror=implicit-function-declaration]
    result = generic_file_aio_write(iocb, iov, numSegs, offset);
    ^
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-FXK2Rz/vmhgfs-only/file.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-FXK2Rz/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-34-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-FXK2Rz/vmhgfs-only'

The filesystem driver (vmhgfs module) is used only for the shared folder 
feature. The rest of the software provided by VMware Tools is designed to work 
independently of this feature.

If you wish to have the shared folders feature, you can install the driver by 
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine. 
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ] 

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

The vmblock enables dragging or copying files between host and guest in a 
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[yes] 

VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can be

enabled/disabled by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no] 

Thinprint provides driver-free printing. Do you wish to enable this feature? 
[yes] 


Disabling timer-based audio scheduling in pulseaudio.



Detected X server version 1.16.0



Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.

Creating a new initrd boot image for the kernel.
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
vmware-tools-thinprint start/running
vmware-tools start/running
The configuration of VMware Tools 9.6.2 build-1688356 for Linux for this 
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

lsgx@UbuntuServer:~/work/vmtools/vmware-tools-distrib$  sudo reboot



关闭虚拟机,更改配置文件
-----------------------------------------
mks.enable3d = "TRUE"

svga.autodetect = "FALSE"
svga.maxWidth = "1366"
svga.maxHeight = "768"
svga.vramSize = "134217728"
----------------------------------------




添加一个启动进入命令行的启动选项

// 更新grub引导
lsgx@lsgx-ubuntu:~$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.16.0-34-generic
Found initrd image: /boot/initrd.img-3.16.0-34-generic
Found linux image: /boot/vmlinuz-3.16.0-30-generic
Found initrd image: /boot/initrd.img-3.16.0-30-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done

//  参考 /boot/grub/grub.cfg 文件, 复制一个menuentry 到40_custom文件中
lsgx@lsgx-ubuntu:~$  sudo cat /boot/grub/grub.cfg 
lsgx@lsgx-ubuntu:~$  sudo vi /etc/default/grub    
--------------------------------------------------------
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX_DE FAULT="quiet splash nomodeset video =uvesafb:mode_option=1366x768-24,mtrr=3,scroll=ywrap "
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
GRUB_GFXMODE=1366x768
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
--------------------------------------------------------

lsgx@lsgx-ubuntu:~$ sudo vi /etc/grub.d/40_custom 
lsgx@lsgx-ubuntu:~$ sudo cat /etc/grub.d/40_custom 
------------------------------------------------------------------------
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# Beginning of the block added by the lsgx - DO NOT EDIT
# Add command mode at 2015-04-09 15:41 by lsgx 
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry ' Ubuntu (command mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-372fcfa6-61c2-4148-b8be-02a3a6f5dc10' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1bb6fb66-2b98-41e7-9033-3d8ee46a0023
else
 search --no-floppy --fs-uuid --set=root 1bb6fb66-2b98-41e7-9033-3d8ee46a0023
fi
linux /vmlinuz-3.16.0-34-generic root=/dev/mapper/ubuntu--vg-root ro   text
initrd /initrd.img-3.16.0-34-generic
}

# End of the block added by the lsgx

---------------------------------------------------------------------------

lsgx@lsgx-ubuntu:~$  sudo grub-mkconfig 
lsgx@lsgx-ubuntu:~$  sudo update-grub

lsgx@lsgx-ubuntu:~$  sudo vi /etc/initramfs-tools/modules
--------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
uvesafb mode_option=1366x768-24 mtrr=3 scroll=ywrap

# End of the block added by the lsgx
-------------------------------------------------

lsgx@lsgx-ubuntu:~$ sudo vi /etc/modprobe.d/blacklist-framebuffer.conf 
-------------------------------------------------------------------------------
#blacklist vesafb
-------------------------------------------------------------------------------

lsgx@lsgx-ubuntu:~$ sudo vi /etc/modules
--------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
#vesafb

# End of the block added by the lsgx
-------------------------------------------------


// 更新 initramfs
lsgx@lsgx-ubuntu:~$  sudo update-initramfs -u
lsgx@lsgx-ubuntu:~$ sudo reboot


虚拟机拍摄快照 >> vmtools
1: 安装vmtools工具
2: 设置系统启动时的屏幕分辨率


中文化和输入法

openSSH设置

lsgx@UbuntuServer:~$ sudo vi /etc/ssh/ssh_config 
-------------------------------------------------------------
# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no

------------------------------------------------------------

lsgx@UbuntuServer:~$ sudo vi /etc/ssh/sshd_config 
------------------------------------------------------------
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

------------------------------------------------------------

lsgx@UbuntuServer:~$  sudo service ssh restart 
ssh stop/waiting
ssh start/running, process 3982


中文支持设置

lsgx@lsgx-ubuntu:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
LC_ADDRESS=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_ALL=

lsgx@lsgx-ubuntu:~$ sudo aptitude install locales
lsgx@lsgx-ubuntu:~$ sudo aptitude install language-pack-zh-hans language-pack-zh-hans-base language-selector-common  
lsgx@lsgx-ubuntu:~$ sudo aptitude install language-pack-gnome-zh-hans-base language-pack-gnome-zh-hans
lsgx@lsgx-ubuntu:~$  sudo cp /var/lib/locales/supported.d/local /var/lib/locales/supported.d/local.bak
lsgx@lsgx-ubuntu:~$  sudo vi /var/lib/locales/supported.d/local
------------------------------
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN GB2312
------------------------------
lsgx@lsgx-ubuntu:~$  sudo cp /etc/default/locale /etc/default/locale.bak
lsgx@lsgx-ubuntu:~$  sudo vi /etc/default/locale 
----------------------------------
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"

---------------------------------
lsgx@lsgx-ubuntu:~$  sudo locale-gen 
lsgx@lsgx-ubuntu:~$  sudo reboot
lsgx@lsgx-ubuntu:~$  locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh:en_US:en
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
LC_ADDRESS=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_ALL=


用户自动登入

lsgx@lsgx-ubuntu:~$ sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 
lsgx@lsgx-ubuntu:~$ sudo cat /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 
----------------------------------------------
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
greeter-show-manual-login=true
allow-guest=false
autologin-guest=false
autologin-user=lsgx
autologin-user-timeout=8
autologin-session=lightdm-autologin
---------------------------------------------


lsgx@UbuntuServer:~$   sudo aptitude install linux-sound-base  alsa-base alsa-utils alsa-source libasound2-dev libasound2-doc
lsgx@UbuntuServer:~$  sudo aptitude install libpulse-dev 
lsgx@UbuntuServer:~$  sudo aptitude install pulseaudio
lsgx@UbuntuServer:~$  sudo dpkg-reconfigure alsa-source
lsgx@UbuntuServer:~$  alsamixer

lsgx@lsgx-ubuntu:~$ sudo usermod -a -G pulse-access root
lsgx@lsgx-ubuntu:~$ sudo gpasswd -a root pulse
正在将用户“root”加入到“pulse”组中
lsgx@lsgx-ubuntu:~$ sudo gpasswd -a root pulse-access
正在将用户“root”加入到“pulse-access”组中
lsgx@lsgx-ubuntu:~$ sudo usermod -a -G pulse-access lsgx
lsgx@lsgx-ubuntu:~$ sudo gpasswd -a lsgx pulse
正在将用户“lsgx”加入到“pulse”组中
lsgx@lsgx-ubuntu:~$ sudo gpasswd -a lsgx pulse-access
正在将用户“lsgx”加入到“pulse-access”组中

lsgx@lsgx-ubuntu:~$ sudo vi /root/.profile
lsgx@lsgx-ubuntu:~$ sudo cat /root/.profile
---------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT

#mesg n
pulseaudio --start --log-target=syslog

# End of the block added by the lsgx
-----------------------------------------------------------

root@lsgx-ubuntu:~# export LANG=en_US
root@lsgx-ubuntu:~# xdg-user-dirs-gtk-update
root@lsgx-ubuntu:~# export LANG=zh_CN
root@lsgx-ubuntu:~# xdg-user-dirs-gtk-update




tmux和fbterm

lsgx@UbuntuServer:~$  sudo aptitude install sysv-rc
lsgx@UbuntuServer:~$  sudo aptitude install sysv-rc-conf
lsgx@UbuntuServer:~$  sudo aptitude install fonts-arphic-uming 
lsgx@UbuntuServer:~$  sudo aptitude install fonts-arphic-ukai
lsgx@UbuntuServer:~$   sudo aptitude install ttf-wqy-microhei ttf-wqy-zenhei
lsgx@UbuntuServer:~$  sudo aptitude install xfonts-wqy
lsgx@UbuntuServer:~$  sudo aptitude install xfonts-intl-chinese
lsgx@UbuntuServer:~$  sudo aptitude install xterm
lsgx@UbuntuServer:~$  sudo aptitude install fbterm
lsgx@UbuntuServer:~$  sudo aptitude install tmux
lsgx@UbuntuServer:~$  sudo aptitude install xserver-xorg-core-lts-trusty xfonts-base x11-xserver-utils-lts-trusty
lsgx@UbuntuServer:~$  sudo aptitude install dbus dbus-x11 
lsgx@UbuntuServer:~$  sudo aptitude install fcitx fcitx-googlepinyin fcitx-frontend-all fcitx-frontend-fbterm
lsgx@UbuntuServer:~$  sudo aptitude install moc moc-ffmpeg-plugin
lsgx@UbuntuServer:~$   sudo  aptitude  install gpm
 

将用户添加到 video组为主用户组(初始群组)
lsgx@UbuntuServer:~$  sudo usermod -a -G  video  root
lsgx@UbuntuServer:~$  sudo usermod -a -G  video  lsgx

将用户添加到 video组为有效群组(次要群组)
lsgx@UbuntuServer:~$  sudo gpasswd -a root vide o  
Adding user root to group video
lsgx@UbuntuServer:~$  sudo gpasswd -a lsgx video 
Adding user lsgx to group video

lsgx@UbuntuServer:~$  sudo chmod u+s  `which fbterm`


lsgx@UbuntuServer:~$  sudo vi ~/.bashrc 
-----------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT

# Add setting fbterm at 2015-04-08 13:16:26
[[ $(tty) == \/dev\/tty[0-9]* ]] && fbterm -- tmux

#xrdb loading xterm color
alias xterm='xrdb ~/.Xresources && xterm -e tmux'

# End of the block added by the lsgx

-----------------------------------------------------------------------

lsgx@UbuntuServer:~$   sudo vi /home/lsgx/.fbtermrc 
-------------------------------------------------------------
# font family names/pixelsize used by fbterm, multiple font family names must be seperated by ','
# and using a fixed width font as the first is strongly recommended
font-names= DejaVu Sans Mono
font-size=12

# max scroll-back history lines of every window, value must be [0 - 65535], 0 means disable it
history-lines=10240

# specify the favorite input method program to run
input-method=fcitx-fbterm

# default terminal screen 256 color
export TERM=fbterm

# restore white color
echo -ne "\e]P7ffffff"
---------------------------------------------------------


lsgx@UbuntuServer:~$   vi ~/.tmux.conf
-------------------------------------------------------------
#
# author   : lsgx <[email protected]>
# modified : 2014-11-12
#

#-- base settings --#
set -g default-terminal "screen-256color"  # 设置终端缺省的支持颜色为256色
set -g display-time 3000     # 提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set -g escape-time 0    # 等待时间的持续时间;设置越小越好
set -g history-limit 65535    # 历史记录条数的最大限制值
#set -g base-index 1    # 窗口的初始序号;默认为0,这里设置为1
#set -g pane-base-index 1    # 面板的初始序号;默认为0,这里设置为1
#set -sg repeat-time 600    # 控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
#set -s quiet on
#setw -g xterm-keys on

#-- bindkeys --#

# prefix key (Ctrl+a)    # 将激活控制台的快捷键由Ctrl+b修改为Ctrl+a
set -g prefix ^a
unbind ^b
bind a send-prefix

# split window    # 窗口分割
unbind '"'
bind - splitw -v # vertical split (prefix -)    # 上下分割窗口
unbind %
bind | splitw -h # horizontal split (prefix |)    # 左右分割窗口

# select pane    # 选择面板
bind k selectp -U # above (prefix k)    # 选择上面板
bind j selectp -D # below (prefix j)    # 选择下面板
bind h selectp -L # left (prefix h)    # 选择左面板
bind l selectp -R # right (prefix l)    # 选择右面板

# resize pane
bind -r ^k resizep -U 2 # upward (prefix Ctrl+k)    # 当前面板上移2
bind -r ^j resizep -D 2 # downward (prefix Ctrl+j)    # 当前面板下移2
bind -r ^h resizep -L 2 # to the left (prefix Ctrl+h)    # 当前面板左移2
bind -r ^l resizep -R 2 # to the right (prefix Ctrl+l)    # 当前面板右移2

# swap pane
bind ^u swapp -U # swap with the previous pane (prefix Ctrl+u)    # 与上面板交换
bind ^d swapp -D # swap with the next pane (prefix Ctrl+d)    # 与下面板交换

# create new session
bind C-c new-session    # 创建一个新的会话

# control sessions
bind z kill-session    # 结束当前会话

# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'    # 查找会话
 
# clear both screen and history
#bind -n C-l send-keys C-l \; run 'tmux clear-history'    # 清空屏幕内容和历史记录

# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"    # 重新加载配置文件

# misc
bind e lastp  # select the last pane (prefix e)    # 选择最后一个面板
bind ^e last  # select the last window (prefix Ctrl+e)    # 选择最后一个窗口
bind q killp  # kill pane (prefix q)    # 关闭当前面板
bind ^q killw # kill window (prefix Ctrl+q)    # 关闭当前窗口


# app
bind ! splitw htop                                     # htop (prefix !)
bind m command-prompt "splitw 'exec man %%'"           # man (prefix m)
bind @ command-prompt "splitw 'exec perldoc -t -f %%'" # perl func (prefix @)
bind * command-prompt "splitw 'exec perldoc -t -v %%'" # perl var (prefix *)
bind % command-prompt "splitw 'exec perldoc -t %%'"    # perl doc (prefix %)
bind / command-prompt "splitw 'exec ri %%'"            # ruby doc (prefix /)


#-- statusbar --#
set -g status-utf8 on    # 开启状态栏的UTF-8支持
set -g status-interval 1    # 状态栏的分辨时间间隔
set -g status-keys vi    # 操作状态栏时的默认键盘布局;可以设置为vi或emacs
set -g visual-activity on    # 开启窗口操作的可视
set -g set-clipboard on    # 开启剪切板
set -g display-panes-time 800 # slightly longer pane indicators display time    # 稍长的窗格中显示的时间指标
set -g display-time 1000      # slightly longer status messages display time    # 稍长的状态消息的显示时间
set -g renumber-windows on    # renumber windows when a window is closed    # 关闭窗口后重新编号

setw -g automatic-rename on    # rename window to reflect current program    # 重命名窗口,以反映当前的程序
setw -g utf8 on    # 开启窗口的UTF-8支持
setw -g monitor-activity on    # 开启窗口活动监视
setw -g mode-keys vi    # 复制模式中的默认键盘布局;可以设置为vi或emacs
setw -g clock-mode-style 24 # 24 hour clock    # 24小时显示方式
#setw -g mode-mouse on    # 开启鼠标模式

# copy mode
bind Enter copy-mode # enter copy mode    # 按Enter进入复制模式
bind b list-buffers  # list paster buffers    # 复制缓冲区列表
bind p paste-buffer  # paste from the top pate buffer    # 粘贴最后复制的缓冲区内容
bind P choose-buffer # choose which buffer to paste from    # 选择粘贴缓冲区

# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
bind -t vi-copy v begin-selection    # 复制模式下开始选取
bind -t vi-copy C-v rectangle-toggle    # 复制模式下矩形选取
bind -t vi-copy y copy-selection    # 复制模式下复制选取的内容
bind -t vi-copy Escape cancel    # 复制模式下退出复制模式
bind -t vi-copy H start-of-line    # 复制模式下开始行选取
bind -t vi-copy L end-of-line    # 复制模式下结束行选取

# mouse resize selcet
#setw -g mouse-resize-pane on    # 鼠标调整面板大小
#setw -g mouse-select-pane on    # 鼠标选择面板
#setw -g mouse-select-window on    # 鼠标选择窗口

# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o -sel clipbaord)\"; tmux paste-buffer" 
# move tmux copy buffer into x clipboard
bind C-y run "tmux show-buffer | xclip -i -sel clipbaord"


#-- colorscheme --#
# see also: https://github.com/daethorian/conf-tmux/blob/master/colors/zenburn.conf

# modes
setw -g clock-mode-colour colour223
setw -g mode-attr bold
setw -g mode-fg colour223
setw -g mode-bg colour235

# panes
set -g pane-border-bg colour234
set -g pane-border-fg colour234
set -g pane-active-border-bg colour232
set -g pane-active-border-fg colour232


# statusbar
set -g status-justify centre
set -g status-bg colour235
set -g status-fg colour248
set -g status-attr dim

set -g status-left "#[fg=green,bright]Session: #S #[fg=yellow,bright]Window: #I #[fg=cyan,bright]Pane: #P"
set -g status-left-attr bright
set -g status-left-length 30
set -g status-right "#[fg=yellow,bright][ #[fg=cyan,bright]#W #[fg=yellow,bright]]#[default] #[fg=yellow,bright]- %Y.%m.%d #[fg=green,bright]%H:%M #[default]"
set -g status-right-attr bright
set-option -g status-right-length 30

setw -g window-status-current-fg colour223
setw -g window-status-current-bg colour237
setw -g window-status-current-attr bold
#setw -g window-status-current-format "#I:#W#F"

#setw -g window-status-alert-attr bold
#setw -g window-status-alert-fg colour255
#setw -g window-status-alert-bg colour160

# messages
set -g message-attr bold
set -g message-fg colour223
set -g message-bg colour235

--------------------------------------------------------------------



lsgx@debian7:~$ vi ~/.Xresources
-----------------------------------------------
! % xrdb -load ~/.Xresources
! % xrdb -query
! % xrdb -symbol
! % xrdb -merge ~/.Xresources

! XTerm config

!look and feel
xterm.termName: xterm-256color
xterm.geometry: 80x36
xterm*scrollBar: false
xterm*rightScrollBar: true
XTerm*jumpScroll:  true
XTerm*SaveLines: 1000
xterm*loginshell: true
xterm*cursorBlink: true
xterm*background:  #1c5572
xterm*foreground:  white
xterm.borderLess: true
xterm.cursorBlink: true
xterm*colorUL: yellow
xterm*colorBD: white

!font and locale
xterm*locale: true
xterm.utf8: true
xterm*utf8Title: true

xterm*fontMenu*fontdefault*Label: Default
XTerm*font: -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
XTerm*wideFont: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: Droid Sans Fallback:antialias=True:pixelsize=14
xterm*xftAntialias: true
xterm*cjkWidth: false

XTerm*font1.Label: efont 12 pixel
XTerm*font1: -efont-fixed-medium-r-normal-*-12-120-75-75-c-60-iso10646-1
XTerm*wideFont1: -efont-fixed-medium-r-normal-*-12-120-75-75-c-120-iso10646-1

XTerm*font2.Label: misc 13 pixel
XTerm*font2: -misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60-iso10646-1
XTerm*wideFont2: -misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1

XTerm*font3.Label: efont 14 pixel
XTerm*font3: -efont-fixed-medium-r-normal-*-14-140-75-75-c-70-iso10646-1
XTerm*wideFont3: -efont-fixed-medium-r-normal-*-14-140-75-75-c-140-iso10646-1

XTerm*font4.Label: efont 16 pixel
XTerm*font4: -efont-fixed-medium-r-normal-*-16-160-75-75-c-80-iso10646-1
XTerm*wideFont4: -efont-fixed-medium-r-normal-*-16-160-75-75-c-160-iso10646-1

XTerm*font5.Label: misc 18 pixel
XTerm*font5: -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
XTerm*wideFont5: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1

XTerm*font6.Label: efont 24 pixel
XTerm*font6: -efont-fixed-medium-r-normal-*-24-240-75-75-c-120-iso10646-1
XTerm*wideFont6: -efont-fixed-medium-r-normal-*-24-240-75-75-c-240-iso10646-1

!fix alt key input 
xterm*eightBitInput: false
xterm*altSendsEscape: true

!print color and bold/underline attributes
xterm*printAttributes: 2
xterm*printerCommand: cat > ~/xtermdump

!mouse selecting to copy, ctrl-v to paste
!Ctrl p to print screen content to file
XTerm*VT100.Translations: #override \
    Ctrl <KeyPress> V: insert-selection(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
    <BtnUp>: select-end(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
    Ctrl <KeyPress> P: print() \n

!-- Tango color scheme
*xterm*color0: #2e3436
*xterm*color1: #cc0000
*xterm*color2: #4e9a06
*xterm*color3: #c4a000
*xterm*color4: #3465a4
*xterm*color5: #75507b
*xterm*color6: #0b939b
*xterm*color7: #d3d7cf
*xterm*color8: #555753
*xterm*color9: #ef2929
*xterm*color10: #8ae234
*xterm*color11: #fce94f
*xterm*color12: #729fcf
*xterm*color13: #ad7fa8
*xterm*color14: #00f5e9
*xterm*color15: #eeeeec
----------------------------------------------------------
lsgx@UbuntuServer:~$   xrdb -load ~/.Xresources


lsgx@UbuntuServer:~$ sudo vi /etc/X11/Xsession.d/95xinput
---------------------------------------------------
export XMODIFIERS="@im=fcitx" 
export XIM=fcitx
export XIM_PROGRAM=/usr/bin/fcitx
export XIM_ARGS=""
export GTK_IM_MODULE=XIM
export QT_IM_MODULE=XIM
export DEPENDS="fcitx"
/usr/bin/fcitx &
----------------------------------------------------
lsgx@UbuntuServer:~$ sudo chmod a+x /etc/X11/Xsession.d/95xinput 

lsgx@UbuntuServer:~$ vi ~/. profile 
lsgx@UbuntuServer:~$ cat ~/.profile 
-----------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT

# Add setting fcitx at 2015-04-08 13:16:26
export XMODIFIERS="@im=fcitx" 
export XIM=fcitx
export XIM_PROGRAM=/usr/bin/fcitx
export XIM_ARGS=""
export GTK_IM_MODULE=XIM
export QT_IM_MODULE=XIM
export DEPENDS="fcitx"
/usr/bin/fcitx &

# End of the block added by the lsgx
---------------------------------------------------------

lsgx@UbuntuServer:~$  im-config
lsgx@UbuntuServer:~$  sudo im-config
lsgx@UbuntuServer:~$  sudo reboot
lsgx@UbuntuServer:~$  dbus-launch 
lsgx@UbuntuServer:~$  fcitx-autostart
lsgx@UbuntuServer:~$  fcitx-configtool
lsgx@UbuntuServer:~$  sudo reboot


samba配置
lsgx@UbuntuServer:~$  sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
lsgx@UbuntuServer:~$  sudo smbpasswd -a lsgx
New SMB password:
Retype new SMB password:
Added user lsgx.
lsgx@UbuntuServer:~$  sudo smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
lsgx@UbuntuServer:~$  sudo pdbedit -L
lsgx:1000:lsgx
root:0:root
lsgx@UbuntuServer:~$  sudo vi /etc/samba/smb.conf         // 在后面追加以下信息
---------------------------------------------------
[SambaShare]
   comment = SambaShare
   browseable = yes
   # path = /
   path = /home
   # valid users = @root
   public = yes
   available = yes
   guest ok = no
   writable = yes
   read only = no
   directory mask = 0775
   create mask = 0664

---------------------------------------------------

lsgx@UbuntuServer:~$  sudo service samba restart


NFS设置
lsgx@UbuntuServer:~$  sudo vi /etc/exports 
-------------------------------------------------------
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#

#/ *(rw,sync,no_root_squash)
/home *(rw,sync,no_root_squash)

-------------------------------------------------------
lsgx@UbuntuServer:~$ sudo service nfs-kernel-server restart 
lsgx@UbuntuServer:/mnt$  sudo mkdir /mnt/image
lsgx@UbuntuServer:/mnt$  sudo chmod 777 /mnt/image
lsgx@UbuntuServer:~$  sudo mount -o nolock,wsize=1024,rsize=1024  192.168.195.134:/home  /mnt/image
lsgx@UbuntuServer:~$  df -h
lsgx@UbuntuServer:~$  ls -alh  /mnt/image
lsgx@UbuntuServer:~$  sudo umount  /mnt/image

虚拟机拍摄快照 >> Terminal
1: auto user login
2: ssh samba nfs
3: zh_CN tmux fbterm xterm


网络设置

lsgx@UbuntuServer:~$  sudo aptitude install resolvconf
lsgx@UbuntuServer:~$  sudo vi /etc/resolv.conf 
lsgx@UbuntuServer:~$  sudo cat /etc/resolv.conf 
-----------------------------------------------------------------------------------
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.195.2
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
-----------------------------------------------------------------------------------

lsgx@UbuntuServer:~$  hostname -f
UbuntuServer
lsgx@UbuntuServer:~$  sudo vi /etc/hosts
lsgx@UbuntuServer:~$  sudo cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 UbuntuServer

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

lsgx@UbuntuServer:~$  sudo cp /etc/network/interfaces /etc/network/interfaces.bak
lsgx@UbuntuServer:~$  sudo vi /etc/network/interfaces
lsgx@UbuntuServer:~$  sudo cat /etc/network/interfaces
-----------------------------------------------------------------------------------
# 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
# auto setting
#auto eth0
#iface eth0 inet dhcp
#auto eth1
#iface eth1 inet dhcp
#auto eth2
#iface eth2 inet dhcp
#auto eth3
#iface eth3 inet dhcp

# manual setting
auto eth0
iface eth0 inet static
        address 192.168.195.155
        netmask 255.255.255.0
        broadcast 192.168.195.255
#network 192.168.195.0
        #gateway 192.168.195.2
        # dns-* options are implemented by the resolvconf package, if installed
        #nameserver 192.168.195.2
        #nameserver 8.8.8.8
        #nameserver 8.8.4.4

auto eth1
iface eth1 inet static       
address 192.168.1.155
netmask 255.255.255.0
broadcast 192.168.1.255
#network 192.168.1.0
        #gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        #nameserver 192.168.1.1
        #nameserver 8.8.8.8
        #nameserver 8.8.4.4

auto eth2
iface eth2 inet static
address 192.168.2.155
netmask 255.255.255.0
broadcast 192.168.2.255
#network 192.168.2.0
        #gateway 192.168.2.1
        # dns-* options are implemented by the resolvconf package, if installed
        #nameserver 192.168.2.1
        #nameserver 8.8.8.8
        #nameserver 8.8.4.4
auto eth3
iface eth3 inet static
address 192.168.185.155
netmask 255.255.255.0
broadcast 192.168.185.255
#network 192.168.185.0
        #gateway 192.168.185.201
        # dns-* options are implemented by the resolvconf package, if installed
        #nameserver 192.168.185.201
        #nameserver 8.8.8.8
        #nameserver 8.8.4.4
gateway 192.168.195.2
# dns-* options are implemented by the resolvconf package, if installed
nameserver 192.168.195.2
#nameserver 192.168.1.1
#nameserver 192.168.2.1
#nameserver 192.168.185.201
nameserver 8.8.8.8
nameserver 8.8.4.4

up route add default gw 192.168.195.2 dev eth0
up route add -net 192.168.195.0 netmask 255.255.255.0 gw 192.168.195.2 dev eth0
up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth1
up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 dev eth2
up route add -net 192.168.185.0 netmask 255.255.255.0 gw 192.168.185.201 dev eth3

# This is an autoconfigured IPv6 interface
# auto setting
iface eth0 inet6 auto
iface eth1 inet6 auto
iface eth2 inet6 auto
iface eth3 inet6 auto

# manual setting


-----------------------------------------------------------------------------------


lsgx@UbuntuServer:~$  sudo vi /etc/resolvconf/resolv.conf.d/base 
lsgx@UbuntuServer:~$  sudo cat /etc/resolvconf/resolv.conf.d/base 
-----------------------------------------------------------------------------------
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 192.168.195.2
#nameserver 192.168.1.1
#nameserver 192.168.2.1
#nameserver 192.168.185.201
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain

-----------------------------------------------------------------------------------

lsgx@UbuntuServer:~$  sudo vi /etc/rc.local
lsgx@UbuntuServer:~$  sudo cat /etc/rc.local
-------------------------------------------------------------------------------
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

route add default gw 192.168.195.2 dev eth0
#route add -net 192.168.195.0 netmask 255.255.255.0 gw 192.168.195.2 dev eth0
#route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth1
#route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 dev eth2
#route add -net 192.168.185.0 netmask 255.255.255.0 gw 192.168.185.201 dev eth3

exit 0
-------------------------------------------------------------------------------

lsgx@UbuntuServer:~$  /etc/init.d/networking restart
lsgx@UbuntuServer:~$  sudo reboot



虚拟机拍摄快照 >> net155
1: ip dns hosts


提示:
系统添加删除用户
1:增加一个swift用户:
    sudo useradd -mk /home/swift -s /bin/bash swift
    为swift用户添加密码:
        sudo passwd swift
2:删除一个用户:
    userdel swift

64位系统安装32位兼容库
dpkg --print-architecture  确认你有一个64位架构的内核
dpkg --print-foreign-architectures  确认你打开了多架构支持功能

$ sudo dpkg --add-architecture i386 打开多架构支持
$ sudo apt-get update
$ sudo apt-get dist-upgrade

$ sudo apt-get install lib32z1 lib32bz2-1.0 lib32ncurses5 lib32ncursesw5 
$ sudo apt-get install gcc-multilib






来自为知笔记(Wiz)


你可能感兴趣的:(Ubuntudesktop14.04.2安装过程)