当前位置:首页 > 系统 > RHEL7.4 安装VirtualBox6.1

RHEL7.4 安装VirtualBox6.1

系统4年前 (2019-12-12)

RHEL7.4 安装VirtualBox6.1

RHEL7.4 安装VirtualBox6.1虚拟CentOS7.7


系统配置

setenforce 0 
sed 's/SELINUX=.*/SELINUX=permissive/g' -i /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service

yum list | grep VirtualBox
yum groupinstall "Server with GUI"
yum install xorg-x11-apps
xclock

yum install binutils qt gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel SDL -y


下载VirtualBox

cd /root
wget https://download.virtualbox.org/virtualbox/6.1.0/VirtualBox-6.1-6.1.0_135406_el7-1.x86_64.rpm
wget https://download.virtualbox.org/virtualbox/6.1.0/Oracle_VM_VirtualBox_Extension_Pack-6.1.0-135406.vbox-extpack


安装VirtualBox

rpm -ivh VirtualBox-6.1-6.1.0_135406_el7-1.x86_64.rpm

RHEL7.4 安装VirtualBox6.1


安装VirtualBox扩展包

VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.0-135406.vbox-extpack

RHEL7.4 安装VirtualBox6.1


拆卸扩展包(如果不需要)

VBoxManage list extpacks
VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"

RHEL7.4 安装VirtualBox6.1


验证

systemctl status vboxdrv
VBoxManage -v

RHEL7.4 安装VirtualBox6.1


校验ISO

sha256sum CentOS-7-x86_64-Minimal-1908.iso
md5sum CentOS-7-x86_64-Minimal-1908.iso


创建虚拟机

virtualbox

RHEL7.4 安装VirtualBox6.1


RHEL7.4 安装VirtualBox6.1

管理---全局设定---语言--简体中文


RHEL7.4 安装VirtualBox6.1

新建


RHEL7.4 安装VirtualBox6.1

这里更改了存储虚拟机的文件夹


RHEL7.4 安装VirtualBox6.1

默认内存2G,这里改为了4G


RHEL7.4 安装VirtualBox6.1

创建虚拟磁盘


RHEL7.4 安装VirtualBox6.1

虚拟磁盘文件类型选择VDI


RHEL7.4 安装VirtualBox6.1

动态分配


RHEL7.4 安装VirtualBox6.1

虚拟磁盘大小设置为20G


RHEL7.4 安装VirtualBox6.1

设置虚拟机


RHEL7.4 安装VirtualBox6.1

虚拟机网卡类型改为桥接,桥接到服务器team0网卡上


RHEL7.4 安装VirtualBox6.1

存储选项中,将第二IDE控制器主通道,浏览到CentOS的ISO上


RHEL7.4 安装VirtualBox6.1

启动虚拟机


RHEL7.4 安装VirtualBox6.1

启动盘为指定的光驱


RHEL7.4 安装VirtualBox6.1

可以开始安装了


设置VirtualBox后台启动

RHEL7.4 安装VirtualBox6.1

启动---无界面启动,这样就可以后台启动虚拟机了


命令行后台启动

VBoxManage startvm "centos7" --type headless

RHEL7.4 安装VirtualBox6.1


命令行关闭虚拟机

VBoxManage controlvm "centos7" poweroff

RHEL7.4 安装VirtualBox6.1


安装虚拟机增强工具

RHEL7.4 安装VirtualBox6.1

VirtualBox工具栏---设备---安装增强功能

yum install -y kernel-devel gcc bzip2 xorg-x11-server-Xorg
mkdir /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom
cd /mnt/cdrom/
./VBoxLinuxAdditions.run

如果出错cat /var/log/vboxadd-setup.log查问题


定时恢复快照

VBoxManage list runningvms
VBoxManage snapshot "centos" take snapshot3 打快照
VBoxManage snapshot centos list  #查看快照名
VBoxManage snapshot centos showvminfo a04d9a25-ec96-4062-b5ce-11f403ac4e1e  #查看快照

vim /root/restore.sh
添加
VBoxManage snapshot centos restore a04d9a25-ec96-4062-b5ce-11f403ac4e1e  
VBoxManage startvm "centos" --type headless

crontab -e
20 9 * * * /root/restore.sh > /dev/null 2>&1


本站所有文章均可随意转载,转载时请保留原文链接及作者。

本文链接:https://www.vos.cn/os/373.html

相关文章

fedora23升级24

fedora23升级24

准备跨版本升级fedora23到24,先在su下安装跨版本升级插件dnf install dnf-plugin-system-upgrade然后输入需要升级的系统版本dnf&nbs...

CentOS7安装cacti

CentOS7安装cacti

网上有一种叫cactiez的集成版本,rrd组件一直有问题,版本也太老,于是就想着重新搭建一个环境试试配置环境关闭Selinux vi /etc/selinux/config 将SELI...

CentOS7 Samba配置

CentOS7 Samba配置

在RAID的基础上搭建samba服务提供文件共享参数介绍[global] workgroup = 工作组名称 server string = 服务...

CentOS7 NFS配置

CentOS7 NFS配置

网络文件系统(Network File System)是一种将远程主机上的分区(目录)经网络挂载到本地的一种机制,通过对网络文件系统的支持,用户可以在本地系统上像操作本地分区一样来对远程主机的共享分区...

CentOS7 Postfix配置

CentOS7 Postfix配置

使用Postfix+Dovecot配置简单的邮件服务器安装Bindyum install bind-chroot配置Bind  编辑主配置文件,里面的各种参数用...

Red Hat Enterprise Linux 6.5安装和分区

Red Hat Enterprise Linux 6.5安装和分区

系统镜像名称为rhel-server-6.5-x86_64-dvd.iso安装Install or upgrade an existing system跳过安装源测试检查Next语言English键盘...