- 基础配置--双网卡设置
root@me:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface enp3s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 172.17.2.126/23
gateway 172.17.3.254
bridge_ports enp3s0
bridge_stp off
bridge_fd 0
auto wlp4s0
iface wlp4s0 inet static
address 172.17.50.99/23
gateway 223.5.5.5
pre-up ip link set wlp4s0 up
pre-up iwconfig wlp4s0 essid ssid
wpa-ssid messiah
wpa-psk me123456
- 去购买弹窗
data.status === 'Active'
/usr/share/pve-manager/js/pvemanagerlib.js
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
- 修改包管理源
/etc/apt/sources.list
deb http://mirrors.163.com/debian wheezy main non-free contrib
deb http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free
deb http://mirrors.163.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.163.com/debian wheezy main non-free contrib
deb-src http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free
deb-src http://mirrors.163.com/debian-security wheezy/updates main contrib non-free
- 解决字符集提示问题
# echo "export LC_ALL=C">>$HOME/.bashrc
# source $HOME/.bashrc
- 安装必要软件
# apt-get update -y && apt-get install aptitude -y
# aptitude install -y vim sudo
- 添加用户
# adduser messiah
Debian下useradd无提示默认不建立用户目录,adduser有提示,RHEL下没有区别
- 查看可用模板
# pveam available
# pveam list local
# pveam update
# pveam download <storage> <template>
obtain an overview of the CPU and hard disk performance.
# pveperf
- LXC容器管理
create container
# pct create 102 local:vztmpl/centos-7-default_20171212_amd64.tar.xz -storage (local-lvm/local-zfs) -rootfs 16 -cores 2 -memory 2048 -swap 4096 -hostname xmtest -description ximao -ostype (debian, ubuntu, centos, fedora, opensuse, archlinux, alpine, gentoo, unmanaged) -net0 name=eth0,bridge=vmbr0,ip=172.16.16.80/24,gw=172.16.16.6 -nameserver 202.101.172.35 -password
create snapshot
# pct snapshot 102 inception -description 'incception snapshot'
list snapshot
# pct listsnapshot <vmid>
set container config
pct set <vmid> [OPTIONS]
# pct set 106 -rootfs local-zfs:basevol-106-disk-1,size=16G -hostname template -description templateclone
# pct set 106 -net0 name=eth0,bridge=vmbr0,ip=172.16.16.67/24
using containers to create templates
pct template <vmid>
# pct template 102
clone container
pct clone <vmid> <newid> [OPTIONS]
# pct clone 102 106 -full 1 -storage local-zfs -hostname clone -description testclone
List LXC
# pct list
Start/Stop LXC
# pct start/stop <vmid>
Console LXC
# pct console <vmid>
# pvesm list <storage>
linux服务封装
1、pveam available --section turnkeylinux
下载
2、pveam download local debian-8-turnkey-openvpn_14.2-1_amd64.tar.gz
创建
3、pct create 800 local:vztmpl/debian-8-turnkey-openvpn_14.2-1_amd64.tar.gz -storage local-zfs -rootfs 16 -cores 2 -memory 2048 -swap 4096 -hostname openvpn -description openvpnserver -ostype debian -net0 name=eth0,bridge=vmbr0,ip=172.16.16.88/24,gw=172.16.16.6 -nameserver 202.101.172.35 -password
pct create 101 local:vztmpl/centos-7-default_20171212_amd64.tar.xz -storage local-lvm -rootfs 128 -cores 2 -memory 2048 -swap 4096 -hostname data -description datacenter -ostype centos -net0 name=eth0,bridge=vmbr0,ip=192.168.18.11/24,gw=192.168.18.1 -nameserver 211.140.13.188 -onboot 1 -password
- PVE用户管理
# pveum groupadd <groupid> [OPTIONS]
# pveum groupadd admin -comment 'just a test group'
# pveum groupdel <groupid>
# pveum groupmod <groupid> [OPTIONS]
# pveum useradd <userid> [OPTIONS]
# pveum useradd wubing@pve -comment 'comment'
# pveum userdel <userid>
# pveum usermod <userid> [OPTIONS]
# pveum usermod wubing@pve -group admin
# pveum passwd <userid>
# pveum passwd wubing@pve
# pveum acldel <path> --roles <string> [OPTIONS]
# pveum aclmod <path> --roles <string> [OPTIONS]
# pveum aclmod / -group admin -role Administrator
# pveum roleadd <roleid> [OPTIONS]
# pveum roledel <roleid>
# pveum rolemod <roleid> --privs <string> [OPTIONS]
- 创建虚拟机
1、镜像路径:/var/lib/vz/template/iso/
2、qm create 301 -memory 1024 -cores 1 -sockets 1 -ostype l26 -name testvpn -description 'a test for ubuntu openvpn servre' -bootdisk scsi0 -scsihw virtio-scsi-pci -scsi0 local-zfs:32 -cdrom local:iso/ubuntu-18.04-live-server-amd64.iso -net0 e1000,bridge=vmbr0
ostype: <l24 | l26 | other | solaris | w2k | w2k3 | w2k8 | win10 | win7 | win8 | wvista | wxp>
Specify guest operating system. This is used to enable special optimization/features for specific operating systems:
ostype | os |
---|---|
other | unspecified OS |
wxp | Microsoft Windows XP |
w2k | Microsoft Windows 2000 |
w2k3 | Microsoft Windows 2003 |
w2k8 | Microsoft Windows 2008 |
wvista | Microsoft Windows Vista |
win7 | Microsoft Windows 7 |
win8 | Microsoft Windows 8/2012/2012r2 |
win10 | Microsoft Windows 10/2016 |
l24 | Linux 2.4 Kernel |
l26 | Linux 2.6/3.X Kernel |
solaris | Solaris/OpenSolaris/OpenIndiania kernel |