2020-06-03 16:05:40
ubuntu-server 上安装KVM
egrep -o '(vmx|svm)' /proc/cpuinfo
apt-get install qemu-kvm libvirt-bin virt-manager bridge-utils
注:virt-manager为GUI管理窗口,bridge-utils:用于网络桥接
lsmod | grep kvm
wget http://mirrors.ustc.edu.cn/ubuntu-releases/trusty/ubuntu-14.04.4-server-amd64.iso
qemu-img create -f raw /data1/kvm/data/kvm-20160724-01.img 1024G
cat > /etc/network/interfaces <<OEF
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto eth1
iface eth1 inet manual
auto br0
iface br0 inet static
address 118.123.9.86
netmask 255.255.255.192
gateway 118.123.9.65
dns-nameservers 144.114.114.114
bridge_ports eth0
auto br1
iface br1 inet static
address 10.10.20.16
netmask 255.255.255.0
gateway 10.10.20.254
bridge_ports eth1
OEF
virt-install --name kvm-20160725-01 --ram 8196 --vcpus=8,sockets=1,cores=8,threads=1 --arch=x86_64 --os-type=linux --os-variant=ubuntutrusty --accelerate --cdrom /data8/kvm/images/ubuntu-14.04.4-server-amd64.iso --boot menu=on --disk path=/data8/kvm/data/kvm-20160725-01.img,size=500,cache=writeback,device=disk --network network=default,model=virtio --graphics vnc,port=-1,listen=0.0.0.0
kvm iptables转发
#!/bin/bash
pro='tcp'
NAT_Host='125.65.43.197'
NAT_Port=3000
Dst_Host='10.10.20.100'
Dst_Port=22
iptables -t nat -A PREROUTING -m $pro -p $pro --dport $NAT_Port -j DNAT --to-destination $Dst_Host:$Dst_Port
iptables -t nat -A POSTROUTING -m $pro -p $pro --dport $Dst_Port -d $Dst_Host -j SNAT --to-source $NAT_Host
#iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -I FORWARD -d 192.168.122.0/24 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
克隆:
virt-clone --original ubuntu-14-tmp --name kvm-20160715-01 --file /data1/kvm/data/kvm-20160715-01.img
在线添加网卡:
virsh attach-interface --domain kvm-20160725-01 --type bridge --source br0 --model virtio --config --live
进入virt-manager
在桌面版的命令窗出入:virt-manager
快速建虚拟机:
修改配置文件:
sudo vim /opt/cd-image/isolinux/isolinux.cfg
# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 1
ui gfxboot bootlogo
sudo vim /opt/cd-image/preseed/ubuntu-bbd-installer.seed
截取修改的部分
# Static network configuration.
d-i netcfg/get_nameservers string 10.0.0.1
d-i netcfg/get_ipaddress string 10.0.0.171 (只修改此行,为虚拟机ip)
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 10.0.0.1
d-i netcfg/confirm_static boolean true
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string bbdtao01 (虚拟机主机名)
d-i netcfg/get_domain string
镜像制作:
mkisofs -r -V "BBD Server Install CD" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ubuntu-bbd-installer-bbdhdp02-net162.iso /opt/cd-image/
创建虚拟机:
virt-install --name bbdhdp02 --hvm --ram 20480 --vcpus 2 --disk path=/data/kvm/bbdhdp02.qcow2,size=100 --bridge=br0 --accelerate --vnc --vncport=5982 --cdrom /home/bbd/ubuntu-bbd-installer-bbdhdp02-net162.iso -d
网址信息:
http://zhidao.baidu.com/link?url=inrg0yVfsi4JF_Okeq06FnMCZDGWUSwoJaK0LwxR7wne4-3hcaxiAFk0fod1DYNnFEbF2VIA9_4Fx1LhO9Z8fdjYMJyPlO8HgTsqQFe-JjS
http://www.linuxidc.com/Linux/2011-03/33653p3.htm
http://wiki.xargs.cn/wiki/doku.PHP/linux:kvm:kvm%E6%89%8B%E5%86%8C
KVM虚拟化平台部署及命令行管理虚拟机教程
03-21
ubuntu 安装MongoDB
07-01
ubuntu安装mongodb数据库服务器
05-29
ubuntu 16.04安装docker-ce v17.03
05-31
KVM虚拟机迁移至esxi的基本流程
06-29
ubuntu 12.04 163 apt source list
07-17
KVM+Qemu+Libvirt实战
04-24
ubuntu 14.04安装Pritunl VPN服务器(带控制面板)
06-09
ubuntu 16.04安装Docker Compose及简单的使用示例
05-21
ubuntu 16.04源码编译安装Nginx 1.10.3
04-21
ubuntu 下为单版本和多版本 PHP 安装扩展
07-01
ubuntu下迁移通过apt安装的MySQL数据库文件目录
07-18
Cherokee配置虚拟主机支持PHP
06-15
Debian 7 (Wheezy)安装配置Apache mod_fastcgi PHP-FPM
07-20
IdeaCentre Y900虚拟BIOS界面
06-25
Intel芯片组USB3.0驱动程序的手动安装方法
07-13
Lenovo G550在Windows XP操作系统下触控板驱动安装方法
07-17
Redhat5系统安装网卡驱动报错
07-21
Win7系统下如何通过添加打印机方法安装打印机驱动程序?
07-15
centos 7 yum安装配置apache 2.4
07-15
虚拟声卡下载
1.97MB
下载虚拟视频软件下载
24.94 MB
下载360安全桌面 v2.8.0.1001 官方安装版
42.53M
下载HofoSetup(安装程序制作软件)v8.5.4 破解版
5.7M
下载MVBOX虚拟视频(音乐播放软件) V4.6.8 破解版
19.04 MB
下载Oracle VM VirtualBox(虚拟机工具)v5.2.14.123301 中文免费版
538.39MB
下载Virtual CloneDrive V5.4.4.0 汉化纯净安装版
1.6MB
下载VirtualBox虚拟机下载
108.47MB
下载daemon tools v3.47(虚拟光驱工具)中文版
485KB
下载pdfcreator(PDF虚拟打印工具)v4.3.0 破解版
31.2M
下载win7虚拟光驱下载
1.3M
下载winmount(虚拟光驱工具)v3.4.1020 免费版
3.87MB
下载xlive(系统U盘安装软件) v1.0 官方版
21.3MB
下载和平网络电视 v2.9.9.9 官方安装版
4.2M
下载硬盘安装器(系统安装工具) 1.6.10.6 中文版
17.35 MB
下载系统之家一键重装系统(系统自动安装工具)12.5.48.1830 最新版
28.4M
下载谷歌地球(虚拟地球仪软件) 5.0 最新版
52.3M
下载酒精120%(虚拟光盘刻录软件)v2.1.0.20601 破解版
38.9M
下载3d蓝光播放器下载
36.8 MB
下载autocad2014(cad设计软件) 免费版
1505.28MB
下载