zoukankan      html  css  js  c++  java
  • 使用字符界面 qemu-kvm 创建虚拟机

    qemu-kvm的基本用法:指定系统类型,CPU运行模式,NUMA(Non Uniform Memory Access Architecture), 软驱设备,光驱设备,硬件设备
     
    # 查看qemu-kvm的帮助
     
     
    # 查看支持的系统类型
    qemu-kvm -M ?
     
    # 下载磁盘镜像文件
    wget http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
     
    # 查看镜像文件的信息
    qemu-img info cirros-0.3.3-x86_64-disk.img
     
    # 创建一个虚拟机实例domain,-name 指明实例的名称,-m指定内存大小,-smp指明CPU的核心数,-drive指明驱动的设备和镜像文件,file=指明磁盘镜像文件,media=指定从地方启动虚拟机实例,if=指定网卡驱动,format=指定虚拟磁盘文件类型 -net指定网络,-nographic指定文本界面启动
    qemu-kvm -name kvm_linux -m 200 -smp 2 -drive file=/root/cirros-0.3.3-x86_64-disk.img,media=disk,if=virtio,format=qcow2 -net none -nographic
     
    # 切换到root用户
    sudo su -
     
    # 可以启动另外一个终端,查看创建虚拟机实例的命令
    cat /proc/2989/cmdline
     
    # 使用Ctrl+a 再按h键,可以查看到帮助
    C-a h print this help
    C-a x exit emulator
    C-a s save disk data back to file (if -snapshot)
    C-a t toggle console timestamps
    C-a b send break (magic sysrq)
    C-a c switch between console and monitor
    C-a C-a sends C-a
     
    # 使用Ctrl+a 再按c键,可以来到虚拟机的管理接口界面
    help 命令可以查看帮助
    system_powerdown 可以关闭计算机
  • 相关阅读:
    LeetCode15 3Sum
    LeetCode10 Regular Expression Matching
    LeetCode20 Valid Parentheses
    LeetCode21 Merge Two Sorted Lists
    LeetCode13 Roman to Integer
    LeetCode12 Integer to Roman
    LeetCode11 Container With Most Water
    LeetCode19 Remove Nth Node From End of List
    LeetCode14 Longest Common Prefix
    LeetCode9 Palindrome Number
  • 原文地址:https://www.cnblogs.com/liu1026/p/7658030.html
Copyright © 2011-2022 走看看