经典RedHat解决问题日志
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/
1. VMware安装(同时解决鼠标移动不方便的问题,解决显示器分辨率不能调整的问题)
VMware安装完成后,默认VMware Tools是没有安装的,启动Linux后,在左下方提示You do not have VMware Tools installed.(没有安装虚拟工具).
安装VMware Tools:
1). 按下CTRL + ALT + F1 组合键,进入Linux的文字界面.
2). 以root身份进入Linux.
3). 按下CTRL + ALT 组合键,进入主操作系统,点击虚拟菜单下的安装虚拟机工具子菜单.
菜单:VM->Install VMware tools....(虚拟机->安装VMware Tools...)
4). 点击"弹出的对话框"中的"Install"按钮,确认安装VMware Tools.
5). 鼠标点击Linux界面,进入Linux.
6). 使用如下命令挂载光驱设备,注意大小写.
mount -t iso9660 /dev/cdrom /mnt/cdrom
7). 使用如下命令,RedHat Linux 9 进入/mnt/cdrom文件夹;Red Hat Enterprise Linux 4 进入/mnt 文件夹.
cd /mnt/cdrom --------->RedHat Linux 9
cd /mnt --------->Red Hat Enterprise Linux 4
8.) 使用如下命令,显示文件夹下的内容.
ls
你将会发现两个文件: VMwareTools-5.5.2-29772.i386.rpm 和VMwareTools-5.5.2-29772.tar.gz .这就是VMware Tools的Linux软件包.(其中5.5.2-29772为版本号,可能会有所不同)
9). 使用如下命令,直接运行rpm包.
rpm -ivh VMwareTools-5.5.2-29772.i386.rpm
你将会看到:
Preparing... ########################################## [100%]
1:VmwareTools ########################################## [100%]
10). 使用如下命令,进入/usr/bin目录.
cd /usr/bin
11). 使用如下命令,查找vmware-config-tools.pl文件.
ls *.pl
12). 运行vmware-config-tools.pl文件.
vmware-config-tools.pl
最后会出现一个界面,让你选择当前屏幕的分辨率.选择一个数字,重新varv启动即可.
2. 在做madplay时经常会遇到下面的错误:./tests: error while loading shared
libraries: xxx.so.0:cannot open shared object file: No such file or directory
意思就是表示系统不知道xxx.so动态文件放在哪个目录下。
需要指明位置
这时就要在/etc/ld.so.conf中加入xxx.so所在的目录。
例:/home/madplay/target-arm/lib
一般而言,有很多so档会在/usr/local/lib这个目录下,所以在/etc/ld.so.conf中加入/usr/local/lib这一行,可以解決此问题。
将/etc/ld.so.conf存档后,还需要执行
切换到/sbin下输入:
ldconfig -v來更新一下才会生效。
3. UNIX系统查看系统内存和交换区
AIX: /usr/sbin/lsattr -El sys0 -a realmem /usr/sbin/lsps -s
HP-UX: grep Physical /var/adm/syslog/syslog.log /usr/sbin/swapinfo -t
LINUX: cat /proc/meminfo|grep MemTotal /sbin/swapon -s
SOLARIS: /usr/sbin/prtconf|grep "Memory size" /usr/sbin/swap -s
4. Determining IP information for eth0...failed
解决办法
1)、以root权限编辑/etc/sysconfig/network-scripts/ifcfg-eth0(假设网卡号是eth0),在文件尾部添加以下内容:
check_link_down
()
{
return 1;
}
2)、激活网卡。
使用DHCP的话可以直接激活网卡,自动获取IP,使用命令:ifconfig eth0 up。
5.ping: unknown host
1)原因,DNS错误,要设成自己的。
2)虚拟机V8之类的要恢复成默认的设置;IP:192.168.222.1 Mask:255.255.255.0
3)Linux上的named是否开起.
6.Could not look up internet address for localhost.localdomain.This will prevent GNOME from operating correctly. It may be possible to correct the problem by adding localhost.localdomain to the file /etc/hosts.
此问题可以根据出错的提示对/etc/hosts文件进行修改,在文件内加入:
127.0.0.1 localhost.localdomain localhost
7. 虚拟机上网方式:DNS,设为主机的网关。
8. 如何产生core ===> ulimit -c 2048
9. FTP到RedHat很慢
1) 清空/etc/reslove.conf中的内容
2) 有DNS时, 如果是虚拟机则在/etc/hosts 下将虚拟机网关地址做为主机IP添加进去,同时在/etc/host.conf 添加解析顺序
A . /etc/host.conf
order hosts,bind #解析顺序为先/etc/hosts,其次DNS
multi on #允许/etc/hosts中一台主机定义多个IP
nospoof on #防止欺骗攻击
B./etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.1 Answar sAnwsar0
192.168.0.150 sAnwar sAnwar1
192.168.222.100 localhost.localdomain localhost
10. red hat linux9 英文界面下使用中文输入法
#cp /etc/sysconfig/i18n /etc/sysconfig/i18n.bak (备份)
# vi /etc/sysconfig/i18n
修改为:
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
LC_CTYPE="zh_CN.GBK"
保存,退出
#reboot
LANGUAGE 选项在企业版不要配置上,否则虚拟机开不了Unity模式
重启,ctrl+空格,看到智能拼音了吧~ 当Linux支持中文后,如果出现有的软件是中文菜单,则在开机时先择语言为English(USA).
/s/blog_607dece60100fe0b.html
/logs/16013064.html
11. 重装VMware将RedHat图形界面搞坏?
1)>redhat-config-xfree86
我的设为1280x720
2) >xrandr -s 0
0在这里是想要的分辨率编号。
12. 查看Linux内核版本
1) >cat /etc/issue
2) >uname –a
3) >man uname
4)>more /etc/issue
5)>cat /etc/redhat-release
13. Before you can compile modules, you need to have the following installed...
make gcc kernel headers of the running kernel
Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes]
怎么路径为“”呢,然后在虚拟机linux系统里GCC,没有安装~装个吧。
于是就在WMware Workstation 7里重新加载当时装RHEL5.4时的ISO文件了!
打开Virtual Machines Settings面板(如果不在全屏状态下,就右击RHEL5.4上面的标签,点击最下面的Settings,在Hardware里单击CD/DVD,然后在右边Use ISO image file旁边单击brows选择你当时安装RHEL5.4时的ISO文件;如果在全屏模式下,就在上面的工具栏里,点击VM->Removable->CD/DVD,下面同上述)。
然后再重新connect(加载)驱动DVD就可以了。
在安装盘里把gcc*.rpm,kernel-devel-*.rpm都安装。
方法是在把这些文件复制到随便一个地方。
然后再打开一个终端,进入这个目录,输入以下命令
rpm -ivh gcc*.rpm --nodeps
rpm -ivh kernel*.rpm --nodeps
安装后进入刚才的终端里按回车,
What is the location of the gcc program on your machine? /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...
The path "" is not valid.
Would you like to change it? [yes]
What is the location of the directory of C header files that match your running
kernel? /lib/modules/2.6.18-164.el5xen/build/include
The path "/lib/modules/2.6.18-164.el5xen/build/include" appears to be a valid
path to the kernel headers of the running kernel.
Would you like to change it? [no]
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-root/modules/vmmemctl-only'
make -C /lib/modules/2.6.18-164.el5xen/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \ MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-164.el5-xen-i686'
CC [M] /tmp/vmware-root/modules/vmmemctl-only/backdoorGcc32.o
搞定了~
14.RedHat and Fedora分配空间建议:
Fedora: /boot 100M /500M /home 2G /usr 8G total: 11G
RedHat:/boot 100M /1G /home 2.5G /usr 8.5G /tmp:2G /var 2G /swap300M total: 19G
Debian: /boot 100M / 300M /home 2G /usr 5G total: 8G
Windows7:C:9G D:6G 15G
WindowsXP: C:6G
15. 各虚拟机IP设置
RedHat: 192.168.222.100
Windows7: 192.168.222.110
Fedora: 192.168.222.120
Debian: 192.168.222.130
16.上海电信DNS
208.67.222.222
208.67.220.220
61.152.82.18
61.177.7.1
221.228.255.1
17. 如何配置XFree86,使得显示器分辨率支持1920x1200?
发行版本:Red Hat Enterprise Linux 3
问题陈述:如何配置XFree86,使得显示器分辨率支持1920x1200?
解决方法:1920x1200并不是一个标准的显示器分辨率配置,如果要使显示器分辨率支持1920x1200,您需要修改X Window系统配置文件/etc/X11/Xf86Config。
在/etc/X11/Xf86Config配置文件中找到Section "Screen"配置段,您需要将1920x1200添加到Modes清单的最前面。
如下例子,将1920x1200添加到Modes清单的最前面。
(两个Modes后的清单都需要加上1920x1200)
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1200" "1600x1200" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1920x1200" "1600x1200" "1024x768" "800x600"
EndSubSection
EndSection
将配置文件/etc/X11/Xf86Config修改保存退出后,您需要重新启动系统使其生效;您也可以同时按住Ctrl Alt Backspace三键来重新启动X Window。
/faq/docs/DOC-12153
/vmware_tools_on_linux
18. VMware Tools 8.0 for VMwar 7.0 install
1) 以root进入Linux;
2) >/sbin/telinit 3 进入纯文本模式,以root登录;
3) 在Windows 下虚拟机菜单下:VM->VM tools install ;
4) >cd /mnt
5) >mkdir cdrom
6) >mount –t iso9660 /dev/cdrom /mnt/cdrom
7) >cp /mnt/cdrom/VMxxxx_tools-xxx.tar.gz /tmp/
8) >umount /dev/cdrom
9) >cd /tmp
10) >tar zxvf VMxxxx_tools-xxx.tar.gz
11) >cd /tmp/vmware-tools-distrib
12) >./*.pl
13) 让你选一个合适的序号
14) 最后显示:
You can now run VMware Tools by invoking the fllowing command:
“/usr/bin/vmware-toolbox” during an X server session.
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 fllowing:
1/ Manually start /usr/bin/vmware-user
2/ Log out and log back into your desktop session; and,
3/ Restart your X session.
To use the vmxnet driver,restart networking using the following commands:
/etc/init.d/nework stop
15) > startx
18.RedHat 下安装Windows字体的方法.
1)>cd /usr/share/fonts/chinese/TrueType
2) 拷贝Windows字体到该目录下
3) > cd /usr/share/fonts/xpFonts
4) > sudo mkfontscale
5) > sudo mkfontdir
6) > sudo fc-cache
7) > reboot
19. 空间情况报告
> df –Tha
>du -h /tmp
>du --max-depth=3
20. 去掉等待时间
> cd /boot/grub/grub.conf
Modify timeout=0
22.修改主机名
/etc/sysconfig/network
HOSTNAME=yourhostname
同时修改/etc/hosts,否则速度很慢
23.有时出现虚拟机拼不通的情况
检查虚似机的DNS和本地的DNS和你所在的地址的DNS是否正常,
208.67.222.222
208.67.220.220
61.152.82.18
61.177.7.1
221.228.255.1
24. 如果存在两个不同的网段;如主机和虚拟机间存在两个网段,时此有可能上不了网;原因用route print 看0.0.0.0 是否有两个目标段;删除一个虚拟机的路由段。
25. _X11TransSocketINETConnect() can't get address for localhost:6011: Name or service not known
看/etc/hosts中是否有127.0.0.1 localhost.localdomain localhost
26. Redhadt 配置邮件系统
(1). /usr/local/msmtp/etc/msmtprc
# Set default values for all following accounts.
defaults
# logfile /opt/msmtp/log/msmtp.log
account 126
host
from xxxx@
auth login
user loginskyo
password xxxx
# Set a default account
account default : 126
(2) /etc/Muttrc
set from=" xxxx@ "
set sendmail="/usr/local/msmtp/bin/msmtp"
set use_from=yes
set realname=" xxxx@ "
set editor="vi"
(3) 测试
echo "测试测试" | mutt -s "测试" 测试邮件地址
mutt -s "Title warnings" ${E_MAIL_LIST} < ${E_MAIL_CONTENT_FILE}。