虚拟化与容器化学习之路
-
CPU 硬件虚拟化扩展指令集: Intel VT-x/AMD-V
- KVM(Kernel-based Virtual Machine): https://www.linux-kvm.org/page/Main_Page
-
Xen(open source hypervisor): https://www.xenproject.org/
-
QEMU(A generic and open source machine emulator and virtualizer): https://www.qemu.org/
-
LXC(Linux Containers): https://linuxcontainers.org/
-
proxmox(open source server virtualization management solution based on QEMU/KVM and LXC): https://pve.proxmox.com/
- Hypervisor: https://en.wikipedia.org/wiki/Hypervisor
Oracle
Oracle VM
VirtualBox
- VirtualBox: https://www.virtualbox.org/
- Manual: https://www.virtualbox.org/manual/
- Free VirtualBox® Images: https://virtualboxes.org/images/
- VirtualBox Images: https://www.osboxes.org/virtualbox-images/
-
VMTransferFiles: https://www.newesttools.com/vmtransfer.php
- VT-x features locked or unavailable in MSR: https://forums.virtualbox.org/viewtopic.php?f=6&t=43403&sid=5ccd991da007192f4c429c657b725eae
-
解决ubuntu下virtualbox访问usb子系统失败: http://blog.coltcn.com/2012/03/13/virtualbox-error-failed-to-access-usb-subsystem/
- VBoxManage: https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi
- 增大VirtualBox虚拟硬盘容量: http://www.cnblogs.com/zhcncn/articles/2948508.html
- VirtualBox 扩展虚拟硬盘容量: http://blog.csdn.net/ganshuyu/article/details/17954733
安装CentOS后安装增强功能
- 启动CentOS,以root身份登录,进入桌面环境。
- 执行如下命令:
yum update
+yum install kernel-devel
+yum install gcc
- 重启系统
- 安装增强功能
- 重新启动
Cannot register the hard disk错误解决办法
virtualbox中加载已有的虚拟硬盘时出现Cannot register the hard disk错误,描述类似下面的。
ERROR: Cannot register the hard disk '/mnt/ee/winxp/xp.vdi' with UUID {395ae4ae-8bf9-42e5-b82a-61af9f95fbf0} because a hard disk '/mnt/ee/winxp/xp.vdi' with UUID {395ae4ae-8bf9-42e5-b82a-61af9f95fbf0} already exists in the media registry ('/home/pzye/.VirtualBox/VirtualBox.xml')
Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, srcDisk.asOutParam())" at line 603 of file VBoxManageDisk.cpp
解决方法如下:关闭virtualbox,重新启动它,它会检测虚拟硬盘,可能会检测出来一些虚拟硬盘,请将其删除,然后就不会出现这个问题了。
virtualbox命令行共享CentOS目录
- 安装virtualbox增强工具
- 设置共享文件夹:完成后点击”设备(Devices)” -> 共享文件夹(Shared Folders)菜单,添加一个共享文件夹,选项固定和临时是指该文件夹是否是持久的。共享名可以随意取,如”jiangxin”,尽量使用英文名称,不要有空格。
- 挂载共享文件夹,在命令行终端下输入:
mkdir /mnt/jiangxin
+mount -t vboxsf jiangxin /mnt/jiangxin
,其中jiangxin
是之前创建的共享文件夹的名字。现在虚拟机和主机可以互传文件了。如不想每次都手动挂载,可以在/etc/fstab中添加一项:jiangxin /mnt/jiangxin vboxsf rw,gid=100,uid=1000,auto 0 0
- 卸载的话使用下面的命令:
umount -f /mnt/jiangxin
Windows 8.1+VirtualBox较新版本打开虚拟机时报错
报错信息:
Unable to load R3 module D:\Program Files\Oracle\VirtualBox/VBoxDD.dll
(VBoxDD):GetLastError=1790
(VERR_UNRESOLVED_ERROR)
解决办法是在Windows/system32下:
- themeui.dll.old.tweakcube替换themeui.dll
- uxtheme.dll.old.tweakcube替换uxtheme.dll
如果是Windows 7中遇到类似问题,参考:http://jingyan.baidu.com/article/ab69b270bb7b2a2ca6189f6d.html
Vmware
- VMware: https://www.vmware.com/
服务器Hypervisor
1998 VMware 公司成立 ├─ 1999 VMware Workstation(第一代,宿主型) ├─ 2001 VMware GSX Server(服务器宿主型,已死) └─ 2001 VMware ESX(第一代裸金属) ├─ 2003 vCenter 前身 VirtualCenter ├─ 2009 ESXi(去 Linux 服务控制台,轻量) │ └─ 今天 vSphere 套件核心 └─ 2014 ESX 彻底停更(路线全部并到 ESXi)
简单理解:
- ESXi 是“地基+承重墙”——裸金属虚拟化操作系统,直接装服务器上,真正让 CPU/内存/网卡变成资源池。
- vCenter Server 是“物业中控室”——一台单独部署的虚拟机(或物理机),集中管理整栋楼的所有 ESXi 主机。
-
vSphere 是整栋楼的“楼盘品牌”——它=地基(ESXi)+物业(vCenter)+门禁/电梯/消防等可选组件(vSAN、vMotion、HA、DRS…),打包卖给你。
- vSphere正确分配虚拟机CPU资源: http://xjlegend.blog.51cto.com/59163/1642460
- 如何通过Vmware vSphere Client安装虚拟机教程: http://jingyan.baidu.com/article/bea41d439726c1b4c51be629.html
- VMWARE ESXI 虚拟硬盘的格式:精简置备、厚置备延迟置零、厚置备置零: http://blog.csdn.net/xiaoxing1521025/article/details/51282248
- Download link for All Versions of VMware vSphere Client: http://www.vmwarearena.com/download-link-for-all-versions-of-vmware-vsphere-client/
- [vSphere 6] vmclicent连接单机时报错: http://bbs.vmsky.com/thread-55705-1-1.html
桌面Hypervisor
- Workstation/Fusion: https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion.html
- Workstation Player and Fusion Player are no longer being sold: https://www.vmware.com/docs/desktop-hypervisor-faqs
Microsoft
2004 Microsoft Virtual PC(收购 Connectix) ├─ 2007 改名为 “Virtual PC 2007” └─ 2009 随 Win7 发布再次改名 → “Windows Virtual PC” | 仅支持 Win7 专业版/旗舰版 | 主打 “XP Mode” 一键运行老程序 ↓ 2012 官方停止开发,下载链接 2025 已下架 ↓ 2008 微软推出 Hyper-V(Windows Server 2008 角色) ├─ 2012 随 Windows 8 进入客户端(Pro/Enterprise) └─ 2025 今天:Win11/WinServer 2025 默认虚拟化底座
简单理解:
- Virtual PC/Windows Virtual PC → Win7 时代的“老玩具”,32 位单核,已进博物馆。
- Hyper-V → 从 Win8 起接班的“正规军”,裸金属、企业级,现在 Win11/WSL2 都靠它跑。
docker
- http://www.docker.com/
- https://hub.docker.com/
- About images, containers, and storage drivers: https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/
-
Install: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
- Kubernetes: https://kubernetes.io/
-
Kubernetes指南: https://kubernetes.feisky.xyz/
- Docker —— 从入门到实践: https://www.gitbook.com/book/yeasy/docker_practice/details
- docker中文: http://www.docker.org.cn/
- DOCKER windows安装: http://blog.csdn.net/zistxym/article/details/42918339
- boot2docker: http://boot2docker.io/
Comments