一半君的总结纸

听话只听一半君

CentOS 7 / Win8.1下安装 virtualbox 5

想测试些东西,怕把系统搞挂

  1. 首先下载 the RHEL repo config.
    cd /etc/yum.repos.d
    wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
    
  2. 添加rpmforge repo
    wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
    rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
    
  3. 安装dkms和依赖
    yum --enablerepo rpmforge install dkms
    yum groupinstall "Development Tools"
    yum install kernel-devel
    
  4. 装!

    yum install VirtualBox-5.0
    
  5. 装centos 7
    CentOS-7-x86_64-Minimal-1503-01.iso
  6. 装好后发现没网卡,vbox里默认选了NAT已经
    去/etc/sysconfig/network-scripts/ifcfg-eth0里,确认有下面三行:

    BOOTPROTO=dhcp
    ONBOOT=yes
    NM_CONTROLLED=no
    

    然后重启网络

    systemctl restart network
    
    # 可以安装软件了
    yum groupinstall "KDE Plasma Workspaces"
    
    # 装好后可以改成默认就进x windows
    systemctl set-default graphical.target
    
  7. 装VirutalBox Guest Additions,否则用不了shared folder功能
    不过之前要先

    yum install kernel kernel-devel kernel-headers gcc
    

    [root@localhost VBOXADDITIONS_5.0.4_102546]# ./VBoxLinuxAdditions.run 
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 5.0.4 Guest Additions for Linux............
    VirtualBox Guest Additions installer
    Removing installed version 5.0.4 of VirtualBox Guest Additions...
    Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
    Copying additional installer modules ...
    Installing additional modules ...
    Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
    Building the VirtualBox Guest Additions kernel modules
    Building the main Guest Additions module[  OK  ]
    Building the shared folder support module[  OK  ]
    Building the OpenGL support module[  OK  ]
    Doing non-kernel setup of the Guest Additions[  OK  ]
    Starting the VirtualBox Guest Additions [  OK  ]
    Installing the Window System drivers
    Installing X.Org Server 1.15 modules[  OK  ]
    Setting up the Window System to use the Guest Additions[  OK  ]
    You may need to restart the the Window System (or just restart the guest system)
    to enable the Guest Additions.
    
    Installing graphics libraries and desktop services components[  OK  ]
    

    共享文件夹可以这样用

    mount -t vboxsf [-o OPTIONS] sharename mountpoint
    # 比如
    sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/<user>/vboxshare
    
    #To mount a shared folder during boot, add the following entry to /etc/fstab:
    sharename   mountpoint   vboxsf   defaults  0   0
    

    参考:
    Access to shared folders in Virtual Box

  8. kde自动login

     $ sudo vim /etc/gdm/custom.conf
     [daemon]
    AutomaticLoginEnable=True  
    AutomaticLogin=oracle # as username is oracle  
    

ps: 后来在windows 8.1下试了下装CentOS 7.1的live cd, 普通版和kde版进桌面前都直接黑掉,只有一个鼠标箭头,Enable EFI默认是没有勾选的,也许是我创建的时候template选了other Linux么,改成 RedHat 64-bit后能看到桌面了,但是很卡,不到1min卡死,又试了升级virtualbox到5.0.4-102546 (之前是5.0.0-101573),还是不行,最后只好用了centos的minimal的iso,这次行了…
一些设定

# 默认就进x windows
systemctl set-default graphical.target

如果你装minimal的时候忘了打开网,装好以后会没网卡,解决方法是/etc/sysconfig/network-scripts/ifcfg-eth0里面加上

NM_CONTROLLED="yes"
ONBOOT="no"

然后

systemctrl restart network

Setting up network from a “minimal” CentOS 6.4 install [duplicate]

参考:
Installing and using VirtualBox on CentOS
How to Enable RPMForge Repository in RHEL/CentOS 7.x/6.x/5.x
CentOS 6.5 in virtual box : can’t install any package

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: