设为首页 收藏本站
查看: 1226|回复: 0

[经验分享] ​ubuntu下安装kvm虚拟机

[复制链接]
发表于 2018-5-2 06:36:20 | 显示全部楼层 |阅读模式
ubuntu下安装kvm虚拟机
  译者: royaso 原作者:howtogeek
  发表时间:2013-02-03浏览量:5421评论数:0挑错数:0
  ubuntu下安装kvm虚拟机,kvm是基于内核的虚拟机,可以安装windows系统哦。 ----------------------------- 快过年了,译者很惨没钱很难过,希望得到支持。本人喜欢折腾,玩过linux,ipad,网页制作,网站建设,翻译水平就这样了,看技术文没问题。可以提供博客空间,wordpress博客及建站,简单的网站扒皮换肤,期待有意者联系我,我的博客是 royaso.com 邮箱:zhang.royaso # gmail .com (#换成@),迫切等待中!!!
  How to Install KVM and Create Virtual Machines on Ubuntu
  ubuntu下安装kvm虚拟机                                                                                                                                               
  ------------------------------
  (译注:图片就不搬了,可以在源地址上看,也可以在我论坛上看
  ubuntu下安装kvm虚拟机
  http://bbs.royaso.com/forum.php?mod=viewthread&tid=108&fromuid=1
  )
  -------------------------------
  If you’re using Linux, you don’t need VirtualBox or VMware to create virtual machines. You can use KVM – the kernel-based virtual machine – to run both Windows and Linux in virtual machines.
  ubuntu下除了常见的虚拟机软件virtualbox和vmware外,还有基于内核的虚拟机kvm,可以安装windows和linux系统哦。
  You can use KVM directly or with other command-line tools, but the graphical Virtual Machine Manager (Virt-Manager) application will feel most familiar to people that have used other virtual machine programs.
  可以直接用命令行也就是终端来创建管理虚拟机,但如果你用过其他的虚拟机软件的话,有图形界面用得会更舒服点。
  Installing KVM(安装)KVM only works if your CPU has hardware virtualization support – either Intel VT-x or AMD-V. To determine whether your CPU includes these features, run the following command:
egrep -c ‘(svm|vmx)’ /proc/cpuinfo
  A 0 indicates that your CPU doesn’t support hardware virtualization, while a 1 or more indicates that it does. You may still have to enable hardware virtualization support in your computer’s BIOS, even if this command returns a 1 or more.
  KVM要求电脑支持cpu虚拟化,Intel的VT-x或者AMD-V都可以。用下面的命令查看
  egrep -c '(svm|vmx)' /proc/cpuinfo
  如果返回的不是A或者0而是其他的就说明你的电脑是支持cpu虚拟化的,也就是可以安装kvm。当然,你需要在主板BIOS开启相关的设置。

  Use the following command to install KVM and supporting packages. Virt-Manager is a graphical application for managing your virtual machines — you can use the kvm command directly, but libvirt and Virt-Manager simplify the process.
  下面的命令是安装kvm的
sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
  Only the root user and users in the libvirtd group have permission to use KVM virtual machines. Run the following command to add your user account to the libvirtd group:
  只有root用户和libvirtd用户组才有权限使用kvm虚拟机,所以用下面的命令添加用户到libvirtd用户组。
sudo adduser name libvirtd

  After running this command, log out and log back in. Run this command after logging back in and you should see an empty list of virtual machines. This indicates that everything is working correctly.
  添加完成后,推出登录然后再登录,运行下面命令,没问题的话就说明没问题了。(笑)
virsh -c qemu:///system list

  Creating Virtual Machines(建立虚拟机)Once you’ve got KVM installed, the easiest way to use it is with the Virtual Machine Manager application. You’ll find it in your Dash.
  在dash里打开kvm虚拟机准备安装系统吧

  Click the Create New Virtual Machine button on the toolbar and the Virtual Machine Manager will walk you through selecting an installation method, configuring your virtual machine’s virtual hardware, and installing your guest operating system of choice.
  点新建,然后跟着指示一步步走:选择安装方式(译注:一般是iso文件安装),设置系统硬件,安装所选系统。

  The process will by familiar if you’ve ever used VirtualBox, VMware, or another virtual machine application. You can install from a disc, ISO image, or even a network location.
  用过vb或vm的都很熟悉这个过程了。可以选择用那个iso镜像文件安装,甚至网络安装!!(译注:你很牛哦)

  To assign more than 2GB of memory to a virtual machine, you’ll need a 64-bit Linux kernel. Systems running 32-bit kernels can assign a maximum of 2 GB of RAM to a virtual machine.
  32位系统只能分配最多2g内存,只有64位才可以分配更多。

  By default, KVM gives you NAT-like bridged networking – your virtual machine won’t appear on the network as its own device, but it will have network access through the host operating system. If you’re running server software in your virtual machine and want it accessible from other devices on the network, you’ll have to tweak the networking settings.
  一般kvm是用nat方式联网的,这种联网方式好处是几乎不用怎么设置就可以上网了,不足就是此虚拟机对外是不可见的,(译注:不过一般够我们用的了),其他的联网方式各有各的好处,自己google吧。

  After selecting your installation method, Virt-Manager will boot the guest operating system in a window. Install the guest operating system as you would on a physical machine.
  接下来的安装就跟安装新系统一模一样了。

  
  Managing Virtual Machines(管理虚拟机)
  The Virtual Machine Manager window displays a list of your installed virtual machines. Right-click virtual machines in the window to perform actions, including starting, shutting down, cloning, or migrating them.
  在列出的虚拟机上右键可以看到各种命令:开启,关闭,克隆,迁移

  You can view information about the virtual machine and configure its virtual hardware by clicking the i-shaped toolbar icon in the virtual machine’s window.
  向下图所示的I图标点击可以设置虚拟机的硬件配置

  ------------------

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-454613-1-1.html 上篇帖子: Ubuntu12.04配置nginx+php+mysql 下篇帖子: ubuntu自动登陆设置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表