下載鏡像
下載桌面版 centos76desktop-x64-template
http://h.njingpin.com:8082/index.php/s/AJGEA9kj8fAbJkJ/download/centos76desktop-x64-template.qcow2
下載obsutil工具
復(fù)制下載鏈接
在centos7里粘貼
加上wget命令進(jìn)行下載
···
解壓
tar -xzvf obsutil_hcso_linux_amd64_5.3.4.tar.gz
進(jìn)入目錄
cd obsutil_linux_amd64_5.3.4/
配置AK,SK,Endpoit
./obsutil config -i=AK** -k=SK** -e=Endpoit**
傳到桶
./obsutil cp /opt/centos76desktop-x64-template.qcow2 obs://cesplugin
····
創(chuàng)建私用鏡像啟動(dòng)ECS
開啟ECS后添加
ifconfig eth0 up
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
重啟網(wǎng)卡服務(wù)
systemctl restart network
我希望用windows遠(yuǎn)程訪問centos圖形界面绊含。xmanager連接centos遠(yuǎn)程桌面,有以下問題:
只能有一個(gè)用戶同時(shí)使用xmanger連接遠(yuǎn)程桌面炊汹,多個(gè)用戶同時(shí)登錄不行躬充。
centos上,因?yàn)間nome硬件加速的原因,導(dǎo)致Xdmcp不可用充甚,而基于xdmcp的xmanager也就無法使用了以政。
如果 直接使用VNC,配置又相對(duì)麻煩一些伴找。而且還要在windows上安裝一個(gè)RealVNC軟件盈蛮。我們希望找到一個(gè)配置簡(jiǎn)單,連接方便的方案技矮。 所以抖誉,這里我使用了 XRDP服務(wù)器。
相關(guān)工具材料:
一臺(tái)安裝了centos系統(tǒng)的電腦(我的是centos7)穆役。
一臺(tái)安裝了windows系統(tǒng)的電腦(我的是win7)寸五。
二梳凛、安裝配置XRDP
下面的很多操作需要root用戶權(quán)限耿币,所以,我們先切換為root用戶:
sudo su - root
安裝epel庫
查詢是否已經(jīng)安裝epel庫:
rpm -qa|grep epel
如果 epel庫 沒有安裝韧拒,則安裝它:
yum install epel-release
安裝xrdp
安裝xrdp服務(wù):
yum install xrdp
因?yàn)閄rdp最終會(huì)自動(dòng)啟用VNC淹接,所以必須安裝tigervnc-server,否則xrdp無法使用叛溢。安裝vnc:
yum install tigervnc-server
為root用戶設(shè)置VNC密碼:
vncpasswd root
修改 xrdp最大連接數(shù)(使用默認(rèn)值塑悼,不修改也是可以的) :vim /etc/xrdp/xrdp.ini(默認(rèn)是32):
max_bpp=32
xrdp最大連接數(shù)設(shè)置
復(fù)制配置文件到/etc/systemd/system/目錄,新文件名"@"后面一定要加冒號(hào) : 否則后續(xù)服務(wù)不會(huì)正常啟動(dòng)
cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
編輯復(fù)制后的新配置文件楷掉,將部分改為指定用戶名
cd /etc/systemd/system/
vi vncserver@:1.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Replace <USER> with the actual user name and edit vncserver
# parameters in the wrapper script located in /usr/bin/vncserver_wrapper
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
加載配置文件厢蒜,并啟動(dòng)
[root@localhost system]# systemctl daemon-reload
[root@localhost system]# systemctl start vncserver@1.service
[root@localhost system]# systemctl enable vncserver@1.service
[root@localhost system]# systemctl status vncserver@1.service
開機(jī)自啟動(dòng)
systemctl start xrdp
systemctl enable xrdp
將ECS服務(wù)器NAT映射出公網(wǎng)