2019独角兽企业重金招聘Python工程师标准>>>

Learn how to run a virtual machine within a virtual machine.

Enabling nested virtualization in KVM

Nested virtualization allows you to run a virtual machine (VM) inside another VM while still using hardware acceleration from the host.

Checking if nested virtualization is supported

For Intel processors, check the /sys/module/kvm_intel/parameters/nested file. For AMD processors, check the /sys/module/kvm_amd/parameters/nested file. If you see 1 or Y, nested virtualization is supported; if you see 0 or N, nested virtualization is not supported.

For example:

$ cat /sys/module/kvm_intel/parameters/nested
Y

Enabling nested virtualization

To enable nested virtualization for Intel processors:

  1. Shut down all running VMs and unload the kvm_probe module:

    # modprobe -r kvm_intel
  2. Activate the nesting feature:

    # modprobe kvm_intel nested=1
  3. Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the /etc/modprobe.d/kvm.conf file:

    options kvm_intel nested=1

To enable nested virtualization for AMD processors:

  1. Shut down all running VMs and unload the kvm_amd module:

    # modprobe -r kvm_amd
  2. Activate the nesting feature:

    # modprobe kvm_amd nested=1
  3. Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the /etc/modprobe.d/kvm.conf file:

    options kvm_amd nested=1

Configuring nested virtualization in virt-manager

Configure your VM to use nested virtualization:

  1. Open virt-manager, double-click the VM in which you wish to enable nested virtualization, and click the Show virtual hardware details icon.

  2. Click CPUs in the side menu. In the Configuration section, there are two options - either type host-passthrough in the Model: field, or select the Copy host CPU configuration check box (that fills the host-model value in the Model field).

      Using host-passthrough is not recommended for general usage. It should only be used for nested virtualization purposes.
  3. Click Apply.

Testing nested virtualization

  1. Start the virtual machine.

  2. On the virtual machine, run:

    # dnf group install virtualization
  3. Verify that the virtual machine has virtualization correctly set up:

    # virt-host-validateQEMU: Checking for hardware virtualization                                 : PASSQEMU: Checking for device /dev/kvm                                         : PASSQEMU: Checking for device /dev/vhost-net                                   : PASSQEMU: Checking for device /dev/net/tun                                     : PASSLXC: Checking for Linux >= 2.6.26                                          : PASS

Additional resources

  • https://bugzilla.redhat.com/show_bug.cgi?id=1055002

  • http://kashyapc.wordpress.com/2012/01/14/nested-virtualization-with-kvm-intel/

  • https://kashyapc.wordpress.com/2012/01/18/nested-virtualization-with-kvm-and-amd/ :!context:

转载于:https://my.oschina.net/u/1777508/blog/1943875

How to enable nested virtualization in KVM相关推荐

  1. Is there a way to enable UEFI support in KVM

    文章目录 install ovmf use kvm with Virtual Machine Manager virt-install install ovmf lwk@qwfys:~$ apt in ...

  2. Linux源码研究-用户管理员手册-内核命令行参数

    下面的列表是__setup(), core_param()和module_param()宏实现的内核参数,内核从命令-开始解析参数,如果参数不被识别,也不包含".",参数会被用来启 ...

  3. vmware嵌套虚拟化对服务器的影响,VMware 虚拟机嵌套部署 KVM 虚拟机小结

    嵌套虚拟化(nested virtualization)是一种在虚拟机内部继续虚拟化的一种技术,Linux Kernel 文档 Nested VMX 对于嵌套虚拟化特性有详细说明.曾经一度认为嵌套虚拟 ...

  4. 在CentOS上进行虚拟化:QEMU、Xen、KVM、LibVirt、oVirt

    Table of Contents 在CentOS上进行虚拟化 1.概述 2.谁做什么? 3. CentOS支持 3.1 CentOS的4 3.2 CentOS的5 Xen4 CentOS快速入门 0 ...

  5. kvm虚拟化框架结构层次梳理及图形化的使用

    关于kvm知识做一次简单梳理回顾,首先了解kvm是什么? kvm的全称是Kernel-based Virtual Machine,从字面意思理解是基于kernel内核的虚拟机,其实是Linux内核模块 ...

  6. KVM从入门到懵逼 第二天 kvm部署

    KVM虚拟化平台部署 一.虚拟机资源 二.实验环境 1.将镜像光盘设为自动/永久挂载 2.环境优化 3.制作本地YUM仓库 三.安装KVM 1.安装工具 2.检测CPU是否支持虚拟化 3. 查看KVM ...

  7. 20200215惠普(HP)星14(R5-3500U)在ubuntu20.04下启动通过dmesg打印的内核信息

    惠普(HP)星14(R5-3500U)在ubuntu20.04下启动通过dmesg打印的内核信息 20:58 2020/2/15 星期六 rootroot@rootroot-HP-Laptop-14s ...

  8. 网工笔记(一):安装EVE-NG实验平台

    EVE-NG是一款流行的网络实验平台,对比思科的packet tracer它的优势是不受操作系统的限制,在Linux和MacBook上都能运行,并且可以导入不同厂家的虚拟设备,包括Juniper, A ...

  9. Mininet FAQ

    2019独角兽企业重金招聘Python工程师标准>>> FAQ lantz edited this page on 20 Oct · 324 revisions Pages 65 M ...

最新文章

  1. php+jq+添加css,jquery如何添加css样式?
  2. 财务大数据比赛有python吗-Python大数据与机器学习之NumPy初体验
  3. 敏捷转型该怎么转?来看看这本书怎么说的吧
  4. 【Linux部署】Greenplum数据库6.13.0单机版【重启实录】(5次报错问题及解决的避坑指南+日志文件查看方法)
  5. input onclick点击button无反应_热图分析:精确洞察用户点击偏好
  6. 说一说,求一个正整数的二进制中0的个数
  7. Codeforces Round #243 (Div. 2) A~C
  8. VC下的人人对弈五子棋(dos)
  9. 使用预计算实时全局光照优化照明-设置场景
  10. 怎么用计算机控制打印机扫描,打印机怎么设置扫描到电脑 打印机设置扫描的步骤方法...
  11. Thermal engine 解析
  12. 脊髓空洞症先知先觉早期症状
  13. 维特比算法(viterbi)原理以及简单实现
  14. 必备模块知识——超声波传感器
  15. 【OS】Process Scheduling Synchronization
  16. 郭彦甫Matlab第四节笔记——初阶绘图
  17. 【数位板常见问题】压感笔为什么没有压感了
  18. 【阅读论文】第四章--分割渗出--博-自动化眼底图像分析技术可筛查糖尿病患者的视网膜疾病
  19. Synology NAS多媒体(Photo Station管理照片)
  20. MATLAB读json文件

热门文章

  1. jQuery原理第五天
  2. Python_列表生成式
  3. 减少HTTP请求的方法
  4. 奥松机器人PHP,Arduino四位七段数码管 LED数码管 4位共阳数码管 显示屏模块
  5. 369寝室(数组、模拟)
  6. R7-8 魔法优惠券 (25 分)
  7. 删除链表中绝对值相等的结点(C++)
  8. linux java mail 时间,Javamail在Windows上工作,而不是在Linux上
  9. php网页脚本代码大全,PHP编写脚本代码的详细教程
  10. html语言怎样设置密码类型,html – 在使用contenteditable div时模仿密码类型输入