centos虚拟机登陆密码运行centos输入密码后显示[root@localhost~]#怎么进入桌面(init 5,startx,setup都试过了)

安装完CentOS 7 Minimal之后,从头打造桌面工作环境
发布时间: 15:31:21
安装完CentOS 7 Minimal之后,从头打造桌面工作环境
HTTP Server(httpd)
U盘装CentOS 7 DVD版不能引导的解决办法 用UltraISO将DVD版的iso刻录到U盘后,删除packages文件夹(节省空间,不删除亦可),将iso文件复制进U盘根目录,开机之后出现 dracut:/# 输入命令 $ cd dev $ ls 找到U盘的盘符,比如sda5,然后重新开机,按方向键选择到第一项Install CentOS 7,按下Tab键,出现 vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet 修改为 vmlinuz initrd=initrd.img repo=hd:/dev/sda5:/ quiet 更改root密码 用root账户登录shell,Alt+(F1~F6)切换tty1~tty6。 # passwd SSH登录 $ ssh root@SERVER_IP_ADDRESS 增加除root之外的常规用户 # useradd newusername # passwd newusername 装完CentOS 7之后,以前装好的win7或是其它系统没有出现在启动项中的解决办法 在/boot/grub2/grub.cfg中添加 menuentry 'Windows 7 Professional' {
set root=(hd0,1)
chainloader +1 } (hd0,1)代表第一个分区。 安装GNOME桌面环境 # yum grouplist # yum groupinstall &GNOME Desktop& CentOS 6.x与CentOS 7的yum group是不同的,CentOS 6.x需要这样 # yum groupinstall &X Window System& &Desktop& &Chinese Support& 启动桌面环境 # startx 设置是否默认启动桌面环境 $ vi /etc/inittab /etc/inittab文件明确声明了inittab is no longer used
when using systemd,并指示了如何用systemd的方式来做。 # systemctl get-default # systemctl set-default multi-user.target # systemctl set-default graphical.target 没有ifconfig命令的解决办法 如果没有安装桌面环境,那么minimal版本没有ifconfig命令。 找出哪个包提供了ifconfig命令 # yum provides ifconfig 或 # yum whatprovides ifconfig 输出中可以看到net-tools包提供了ifconfig命令。 # yum install net-tools 网络配置 $ ifconfig -a
# ifconfig enp0s3 up // 开启enp0s3网卡 # ifconfig enp0s3 down // 关闭enp0s3网卡 $ dhclient enp0s3 // 发送DHCP请求 DNS工具与Windows一样 $ nslookup 安装第三方源(EPEL和RPMForge) CentOS官方文档声称严重推荐EPEL,不推荐RPMForge,因为RPMForge已经不再被维护了,虽然曾经被CentOS推荐。 EPEL 官方网站http://fedoraproject.org/wiki/EPEL EL7下载地址http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html # rpm -ivh epel-release-7-5.noarch.rpm EPEL的repo文件已经在目录/etc/yum.repos.d/下。 RPMForge 官方网站http://repoforge.org/ EL7下载地址http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm # rpm -ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm RPMForge的repo文件已经在目录/etc/yum.repos.d/下。 安装C++编译器 # yum install gcc-c++ 挂载NTFS文件系统 CentOS自身的源里没有支持NTFS的包,需要从EPEL或RPMForge(也叫RepoForge)源里安装。 # yum install ntfs-3g --enablerepo=epel 或 # yum install fuse-ntfs-3g --enablerepo=rpmforge 安装VirtualBox VirtualBox要编译内核,所以需要kernel-devel这个包。 # yum install kernel-devel # yum localinstall *.rpm 对于VirtualBox只能装32位系统的情况,涉及到Host的CPU是否支持虚拟化以及是否开启了虚拟化,如果没有开启,在BIOS里面设置,一般在CPU的子设置里面,且含有“Virtualization”或“Virtual”字样,将它设为Enable。 安装Markdown解析器(python-markdown) Linux下Markdown解析器有很多,CentoOS官方Yum源(extras)里有python-markdown。 # yum install python-markdown python-markdown的命令名是markdown_py,查看帮助。 $ markdown_py -h 用法简单,举例说明,用以备忘。
解析*.md,输出html内容到stdout。 $ markdown_py *.md 解析*.md,利用重定向,输出html内容到*.html。 $ markdown_py *.md & *.html 可以不使用重定向,利用markdown_py命令的-f选项,输出html内容到*.html。 $ markdown_py -f *.html *.md -o选项用来指定解析完之后html的输出格式,可以是html5、html4和xhtml1,默认xhtml1,所以最好明确指定-o选项。 $ markdown_py -o html5 *.md & *.html
安装Flash Player
adobe官网下载yum安装包 # rpm -ivh *.rpm # yum install flash-plugin --enablerepo=adobe-linux-x86_64 adobe官网下载rpm安装包 # rpm -ivh *.rpm 利用RPMforge # yum install flash-plugin --enablerepo=rpmforge
安装wkhtmltopdf # yum localinstall wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm # wkhtmltopdf http://wkhtmltopdf.org/ wkhtmltopdf.pdf 安装MPlayer RPMforge(现在叫RepoForge)的repo中没有CentOS 7的smplayer,所以需要源代码安装。 安装MPlayer通常需要以下3个东西:
source code(源代码tarball文件) binary codecs(一堆二进制的解码器文件) a skin(皮肤)
官网下载source code。 $ ./configure --enable-gui --language=zh_CN --disable-ossaudio --enable-gui告诉configure以后运行MPlayer需要图形界面,不仅只从command line运行。 --language=zh_CN告诉configure安装中文环境。 --disable-ossaudio是因为linux2.4以后的内核逐渐抛弃oss音频架构而转向alsa(详细说明请参考http://blog.csdn.net/meizum10/article/details/)。 提示No FFmpeg checkout, press enter to download one with git or CTRL+C to abort,按下回车键。 通常configure会失败,因为需要一些依赖。它告诉缺什么就装什么。 提示./configure: line 1522: git: command not found Failed to get a FFmpeg checkout,configure需要利用git下载ffmpeg,如果git没有安装,那么就安装git。 # yum install git 提示Error: Compiler is not functioning correctly. Check your installation and custom CFLAGS
.,源代码编译安装当然需要gcc,如果没有安装,那么就安装它。g++依赖于gcc,所以为了以后省事,干脆安装g++。 # yum install gcc-c++ 提示Error: yasm not found, use --yasm='' if you really want to compile without,缺少yasm,去yasm官网http://yasm.tortall.net下载源代码tarball,简单的三步走: $ ./configure $ make $ su # make install In function avcodec_register_all' 提示Error: The GUI requires X11.`,缺少X11,yum安装gtk2-devel,注意要安装gtk2-devel,gtk3-devel不行。 # yum install gtk2-devel configure通过,接着 $ make $ su # make install OK,安装完成,在command line里运行mplayer 媒体文件名一般可以播放。 官网下载binary codecs,是个tarball,解压,得到一堆解码器文件,将这些解码器文件放到/usr/local/lib/codecs/里。/usr/local/lib/下如果没有codecs文件夹,那就手动创建一个。 官网下载skin文件(我安装的是clearplayer),是个tarball,解压,得一文件夹,将这文件夹放到/usr/local/share/mplayer/skins/里,之后建立一个叫default的符号链接,指向皮肤文件夹。 # ln -s &文件夹名字& default 当然,也可以把文件夹名字直接改成default。 如果播放没有声音,那么就这么干: # yum install *alsa* 安装了一堆alsa相关的东西。 至于CentOS 6.x,RPMforge(现在叫RepoForge)的CentOS 6.x的repo中有smplayer,所以直接yum安装。 # yum install smplayer --enablerepo=rpmforge 配置GoAgent 服务端上传: $ python server/uploader.py // linux & mac 双击server/uploader.bat // windows 客户端运行: $ python local/proxy.py // linux & mac 双击local/goagent.exe // windows Firefox和Opera需要导入证书。 对于CentOS 6.x: # yum install centos-release-SCL # yum install python27 在/etc/ld.so.conf.d/文件夹中建立文件python27.conf,内容为/opt/rh/python27/root/usr/lib64。 # ldconfig // 加载配置 $ /opt/rh/python27/root/usr/bin/python proxy.py 安装配置管理Git 安装 # yum install git git config 安装完需要用git config配置user name和user email,否则不能commit。 $ git config --global user.email && $ git config --global user.name &Your Name& $ git config --list git config有3种选项,对应不同配置文件。
--system /etc/gitconfig --global ~/.gitconfig no option .git/config
SSH KEY 为了使用GitHub的SSH keys功能,利用ssh-keygen工具在本地生成rsa密钥对。 $ ssh-keygen -t rsa -C &your_& // generate a rsa key pair in the file ~/.ssh/id_rsa & ~/.ssh/id_rsa.pub $ ssh-keygen -p //adding or changing a passphrase .gitignore 各种类型的gitignore模板https://github.com/github/gitignore。 # 此为注释 *.a 忽略所有目录下.a结尾的文档 !lib.a 但不忽略lib.a文档 *.[oa] 忽略所有目录下.a或.o结尾的文档 *~ 忽略所有目录下~结尾的文档 TODO 忽略所有目录下的TODO文档 /TODO 仅仅忽略根目录下的TODO文档 build/ 忽略所有目录下的build文件夹 /build/ 仅仅忽略根目录下的build文件夹 doc/**/*.txt 忽略doc文件夹下的所有.txt文档 星号*匹配零个或多个任意字符 [abc] 匹配任何一个列在方括号中的字符(这个例子要么匹配一个 a,要么匹配一个 b,要么匹配一个 c) 问号?只匹配一个任意字符 如果在方括号中使用短划线分隔两个字符,表示所有在这两个字符范围内的都可以匹配,比如 [0-9] 表示匹配所有 0 到 9 的数字 常用命令 $ git init $ git add * $ git commit -m 'message'
$ git status $ git status -s $ git status --short
$ git diff
$ git clone :who/whatrepo.git $ git clone https://github.com/who/whatrepo $ git clone https://github.com/who/whatrepo SpecifiedFolder
$ git remote $ git remote -v $ git remote add [shortname] [url] $ git remote rm [remote-name] $ git remote rename [old-name] [new-name] $ git remote fetch [remote-name] $ git push [remote-name] [branch-name] $ git pull 安装配置管理(httpd) 安装 # yum install httpd 管理 在Windows下,httpd是以系统服务的形式运行,在Unix(Linux)下,httpd作为daemon(守护进程)运行。 httpd官方文档推荐用apachectl这个script来调用httpd可执行程序,原因是:apachectl首先会设置一些为保证httpd正确运行所必要的环境变量,然后再去调用httpd可执行程序,而且apachectl会把命令行参数原封不动的传递给httpd。 apachectl是httpd daemon的front end。所以管理员应该用apachectl来管理httpd daemon。 apachectl在CentOS 6.x和CentOS 7下均可用。 # apachectl start # apachectl stop或graceful-stop # apachectl restart或graceful # apachectl status 如果不使用apachectl这个script,也可以使用service这个管理daemon的命令。 # service httpd start # service httpd stop # service httpd restart # service httpd status 如果系统支持systemd(CentOS 7开始支持systemd),既可以用service命令,也可以用systemd。 # systemctl start httpd.service # systemctl stop httpd.service # systemctl restart httpd.service # systemctl status httpd.service # systemctl is-active httpd.service 设置开机自动启动 要设置开机自动启动httpd,需要区分在CentOS 6.x和CentOS 7下2种情况。 CentOS 6.x没有systemd,我最喜欢的方式是修改/etc/rc.d/rc.local这个文件。 # vi /etc/rc.d/rc.local 添加以下命令。 /usr/sbin/apachectl start CentOS 7用了systemd。 # systemctl enable httpd.service # systemctl disable httpd.service 理解并设置虚拟主机 httpd的主配置文件是/etc/httpd/conf/httpd.conf。目录/etc/httpd/conf.d/下的文件只要以.conf作为扩展名,其内容就能被集成到主配置文件中。所以尽量不直接修改主配置文件,而是在目录/etc/httpd/conf.d/下面搞。 httpd官方文档把Virtual Host(虚拟主机)分为了2种:IP-based和Name-based。 我的理解是: 在配置文件里放一个&VirtualHost&&/VirtualHost& block,就代表配置了一个Virtual Host,放2个就代表配置了2个。起始标签&VirtualHost&里需要说明IP地址和端口,即这个样子&VirtualHost 192.168.1.1:80&,IP可以是*,端口可以不写。 一个request来了之后,就根据IP地址和端口按照配置文件中的顺序来一个个匹配&VirtualHost&&/VirtualHost& block。如果所有的&VirtualHost&&/VirtualHost& block都没匹配上,那么就去咨询主配置文件里的指示了。而一旦某些&VirtualHost&&/VirtualHost& block匹配上了,那么只有这些匹配上的block才能成为request的候选者,其它的&VirtualHost&&/VirtualHost& block包括主配置文件就都没有机会了。 如果候选者只有1个,那么没的挑了,就是你了。而如果候选者有多个,怎么选? 就得看&VirtualHost&&/VirtualHost& block里面的ServerName和ServerAlias指示了,谁的ServerName、ServerAlias与request的HTTP报文的header的Host相匹配,那么谁就胜出。如果多个block都匹配,那么先来后到,谁在前边谁胜出。如果都不匹配,那么还是先来后到。 Listen 80 &VirtualHost *:80&
DocumentRoot /var/www/html
ServerName www.example.com
ServerAlias example.com
&/VirtualHost& &Directory &/var/www/html&&
AllowOverride All &/Directory& AllowOverride All的作用是使web目录内的.htaccess文件起作用,常用于开启Drupal的简洁URL。 如果VirtualHost指定了端口,需要写上Listen指示,因为只有先告诉httpd监听某个端口,request才能从这个端口进来,进而进入某个VirtualHost。httpd主配置文件默认已经配置了Listen 80,所以VirtualHost如果指定80端口,就不需要再此指示监听80端口了,配置文件里重复的指示不符合语法。 安装配置管理MySQL(MariaDB) 安装 MySQL # yum install mysql-server MariaDB # yum install mariadb-server mysql-server package依赖于mysql package,所以没必要这么做:yum install mysql mysql-server。 管理 MySQL # service mysqld start # service mysqld stop # service mysqld restart # service mysqld status MariaDB # service mariadb start # service mariadb stop # service mariadb restart # service mariadb status 也可以用systemd方式 # systemctl start mariadb.service # systemctl stop mariadb.service # systemctl restart mariadb.service # systemctl status mariadb.service # systemctl is-active mariadb.service 配置 # mysql_secure_installation 或 # mysqladmin -u root password '' 设置开机自动启动 MySQL # vi /etc/rc.d/rc.local 添加以下命令 /usr/sbin/service mysqld start MariaDB # systemctl enable mariadb.service # systemctl disable mariadb.service 登录 $ mysql -hhost -Pport -Ddatabase -uusername -p 登录后的常见命令 & create database if not exists * default character set utf8; & & use *; & 安装配置管理PHP 安装 # yum install php 仅仅安装PHP往往是不够的,通常还需要安装模块。 # yum install php-mysql # yum install php-gd # yum install php-xml # yum install php-mbstring 配置 PHP配置文件 /etc/php.int 通常需要改配置文件 upload_max_filesize = 2M Linux(Yum系)常用压缩打包命令 .tar.gz $ tar xzvf *.tar.gz $ tar czvf *.tar.gz file1 file2 .tar.bz2 $ tar xjvf *.tar.bz2 $ tar cjvf *.tar.bz2 file1 file2 .tar.xz $ tar xJvf *.tar.xz $ tar cJvf *.tar.xz file1 file2 .zip # yum install zip unzip $ zip *.zip file1 file2 $ unzip *.zip .rar # yum install rar --enablerepo=rpmforge $ rar a *.rar file1 file2 $ rar x *.rar .7z # yum install p7zip --enablerepo=rpmforge $ 7za a *.7z file1 file2 $ 7za x *.7z Yum和RPM常用命令备忘录 yum history # yum history # yum history list &ID& # yum history info &ID& # yum history undo &ID& # yum history redo &ID& yum update # yum clean all # yum makecache # yum update rpm安装卸载 # rpm -ivh *.rpm # rpm -qa # rpm -qa|grep * # rpm -e * # rpm -e * --nodeps 制作bash脚本 #!/bin/bash write cmd line here # comment Hard Link(硬链接) $ ln target_file link_file Symbolic Link(符号链接、软链接) $ ln -s target_file link_file 查找文件 $ find / -name &*& 常用配置文件 /etc/resolv.conf /etc/hosts /etc/inittab /etc/yum.repos.d/ ~/.config/user-dirs.dirs ~/.bash_profile 改变Aptana Rubles文件夹默认在家目录的解决办法 eclipse.ini文件中,在-vmargs之后添加 -Dstudio.rubleUserLocation=Aptana Rubles GNOME配置 $ gnome-tweak-tool
来源:http://www.cnblogs.com/oysmlsy/p/4567903.htmlcentos进入[root@locahost ~]#后怎么进入桌面?_百度知道
centos进入[root@locahost ~]#后怎么进入桌面?
我有更好的答案
只要安装并配置好了Gnome或KDE等图形界面 在终端模式下运行 startx 即可进入图形界面
采纳率:37%
为您推荐:
其他类似问题
您可能关注的内容
centos的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。求救:centos只能访问内网不能访问外网,以并且出现执行route 命令后的默认网关很慢才出现
&Q:centos安装好后,进行了IP及NFS和GW设置,可以在局域网用SSH登录,但是本机只能访问内网不能访问外网,以并且出现执行route 命令后的默认网关很慢才出现
&[root@localhost ~]# route Kernel IP routing table Destination&&&& Gateway&&&&&&&& Genmask&&&&&&&& Flags Metric Ref&&& Use Iface 192.168.1.0&&&& *&&&&&&&&&&&&&& 255.255.255.0&& U&&&& 0&&&&& 0&&&&&&& 0 eth0 169.254.0.0&&&& *&&&&&&&&&&&&&& 255.255.0.0&&&& U&&&& 0&&&&& 0&&&&&&& 0 eth0 default&&&&&&&& 192.168.1.1&&&& 0.0.0.0&&&&&&&& UG&&& 0&&&&& 0&&&&&&& 0 eth0 &&------------------这条记录将近要等20秒才会出来&
[root@localhost ~]# ping 192.168.1.237
PING 192.168.1.237 (192.168.1.237) 56(84) bytes of data.
64 bytes from 192.168.1.237: icmp_seq=1 ttl=128 time=0.349 ms
64 bytes from 192.168.1.237: icmp_seq=2 ttl=128 time=0.470 ms
[root@localhost ~]# ping
ping: unknown host
[root@localhost ~]# ifconfig (以下信息被部分删节) eth0&&&&& Link encap:Ethernet& HWaddr 00:10:5C:EA:1A:38 &&&&&&&&& inet addr:192.168.1.246& Bcast:192.168.1.255& Mask:255.255.255.0
lo&&&&&&& Link encap:Local Loopback &&&&&&&&& inet addr:127.0.0.1& Mask:255.0.0.0
以下我的网络配制:
windows下IP配制,可以访问外网
CENTOS配制
[root@localhost ~]# ifconfig
eth0&&&&& Link encap:Ethernet& HWaddr 00:10:5C:EA:1A:38
&&&&&&&&& inet addr:192.168.1.246& Bcast:192.168.1.255& Mask:255.255.255.0
&&&&&&&&& UP BROADCAST RUNNING MULTICAST& MTU:1500& Metric:1
&&&&&&&&& RX packets:18287 errors:0 dropped:0 overruns:0 frame:0
&&&&&&&&& TX packets:2990 errors:0 dropped:0 overruns:0 carrier:0
&&&&&&&&& collisions:0 txqueuelen:1000
&&&&&&&&& RX bytes:.8 MiB)& TX bytes:0.3 KiB)
&&&&&&&&& Interrupt:169 Base address:0x2000
lo&&&&&&& Link encap:Local Loopback
&&&&&&&&& inet addr:127.0.0.1& Mask:255.0.0.0
&&&&&&&&& UP LOOPBACK RUNNING& MTU:16436& Metric:1
&&&&&&&&& RX packets:14244 errors:0 dropped:0 overruns:0 frame:0
&&&&&&&&& TX packets:14244 errors:0 dropped:0 overruns:0 carrier:0
&&&&&&&&& collisions:0 txqueuelen:0
&&&&&&&&& RX bytes:.3 MiB)& TX bytes:.3 MiB)
[root@localhost ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-C/8139C+
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:10:5C:EA:1A:38
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.246
NETWORK=192.168.1.0
[root@localhost ~]# more /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1
[root@localhost ~]# more /etc/resolv.conf
search localdomain
nameserver 202.101.226.68
nameserver 202.101.224.69
[root@localhost ~]# service network restart
Shutting down interface eth0:&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
Shutting down loopback interface:&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
Bringing up loopback interface:&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
Bringing up interface eth0:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
以下是问题补充:
:防火墙已关闭
[root@localhost ~]# service iptables stop
Flushing firewall rules:
Setting chains to policy ACCEPT: filter
Unloading iptables modules:
[root@localhost ~]# iptables -vnL
Chain INPUT (policy ACCEPT 21 packets, 1819 bytes)
pkts bytes target
prot opt in
destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target
prot opt in
destination
Chain OUTPUT (policy ACCEPT 13 packets, 1628 bytes)
pkts bytes target
prot opt in
destination
试试先把防火墙关掉看看呢?
service iptables stop
--- 共有 1 条评论 ---
感谢你的回复,关闭还是不行。
[root@localhost ~]# iptables -vnL
Chain INPUT (policy ACCEPT 21 packets, 1819 bytes)
pkts bytes target
prot opt in
destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target
prot opt in
destination
Chain OUTPUT (policy ACCEPT 13 packets, 1628 bytes)
pkts bytes target
prot opt in
destination
这个问题解决了吗?我也遇到了同样的问题。
如已解决,希望给我答案。我的email:wanwanabc@hotmail.co.jp
主要是放火墙和iptables 配置, 注意NAT&& ,还就是XP网络使用服务器网关,有问题联系
这个问题我也遇到了并解决了,是DNS的问题,设一个内网的DNS或把内网DNS放在resolv.conf最前面就可以了
--- 共有 1 条评论 ---
内网dns是什么
/etc/sysconfig/network-scripts& 目录下新件了 文件& route-eth0
添加内容& via 192.168.1.1
重启网络:service network restart &然后ping www.baidu.com&
问题原因:系统缺少路由 配置
说明: 亲测.实验成功! - -
--- 共有 2 条评论 ---
这个ip是网关
怎么解决的,求指教。我的不行, via
这个ip从哪获取的
怎么解决的,求指教。我的不行, via &ip &这个ip从哪获取的博客分类:
CentOS中如何进入图形界面和文字界面,Linux真正的服务器是不会运行图形化界面的,怎么样才能在不卸载桌面的前提下开机直接进入命令界面呢?(我安装的是CentOS 6.5)下面就简单介绍以下:
一、如果要进入图形界面:
1.首先得安装有图形界面,一般为X-window图形界面。
2.启动linux在终端下输入:startx 即可进入X11的图形操作界面。
二、在图形界面还可以在多个界面中进行切换:
在X-window图形操作界面中按“Alt+Ctrl+功能键Fn n=1~6 ”就可以进入Console字符操作界面。按“Alt+Ctrl+F7”即可回到刚才的X-window中。
三、如何每次都自动进入xwindos或者字符界面?
开机后进入图形化界面还是进入命令行取决于inittab文件中的配置。该文件位于etc目录下。
打开/etc/inittab 文件
#vim /etc/inittab
在默认的 run level 设置中,可以看到第一行书写
如:id:5:initdefault:(默认的 run level 等级为 5,即图形 界面)
将第一行的 5 修改为 3 即可。
保存文件后重启系统你就可以看见是启动的文本界面了。
另外在文本模式如果想启动图形界面,可以使用下面的方法:
下面是命令界面的修改,在最尾部修改“3”代表是命令界面
[root@DFK ~]# vim /etc/inittab # inittab is only used by upstart for the default runlevel.## ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.## System initialization is started by /etc/init/rcS.conf## Individual runlevels are started by /etc/init/rc.conf## Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf## Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,# with configuration in /etc/sysconfig/init.## For information on how to write upstart event handlers, or how# upstart works, see init(5), init(8), and initctl(8).## Default runlevel. The runlevels used are:#
0 - halt (Do NOT set initdefault to this)#
1 - Single user mode#
2 - Multiuser, without NFS (The same as 3, if you do not have networking)#
3 - Full multiuser mode#
4 - unused#
6 - reboot (Do NOT set initdefault to this)#
id:3:initdefault:
取消按下Ctrl+Alt+Delete组合键重启Linux
从shell登录Linux之后,有时候一不下小心按下 Ctrl+Alt+Delete 组合键,系统就重启了,如果发现自己正在做着一些操作工作,就麻烦了,或者有别的终端用户也登录到系统上,也做着任务,系统重启就更麻烦了,而且没有任何的提示。
取消按下 Ctrl+Alt+Delete 组合键,系统就重启。登录到Linux系统,用编辑器打开 vi
/etc/inittab 文件,找到第32 行:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
把这一行注释掉就行了,改为:
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now
保存退出。
用 init q 命令使刚才的修改立即生效,也可以重启Linux系统后使其生效。
另外,centos 6 里 这个组合键 的设置单独放在里另外一个文件里:/etc/init/control-alt-delete.conf 。
CentOS6.X 禁止同时按下Ctrl+Alt+Del重启
编辑/etc/init/control-alt-delete.conf
start on control-alt-delete
#start on control-alt-delete
mv /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.conf.bak
注:以上所有方法,网上很多人说操作完成后,需要重启一下才能生效;本人在测试过程中,无须重启即刻生效了。
zhouchaofei2010
浏览: 714790 次
来自: 上海
Saro 写道在log4j配置里把mapper所在包设为deb ...
在log4j配置里把mapper所在包设为debug就行了,参 ...
杀手请杀人 写道能看到scala太难得了
能看到scala太难得了
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'}

我要回帖

更多关于 虚拟机centos root 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信