Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Getting VM console with WebMKS
Search
MasahiroIrie
October 21, 2020
Technology
2.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting VM console with WebMKS
VMware DevOps Meetup #6 (2020/10/21)
MasahiroIrie
October 21, 2020
More Decks by MasahiroIrie
See All by MasahiroIrie
Is that compatibility... actually OK?
mirie_sd
0
86
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
1.5k
Making new vExpert badge sticker
mirie_sd
0
750
How to use "VMware"
mirie_sd
0
840
The key to VCP-VCF
mirie_sd
0
3k
Now is the time to check the vSphere Security Configuration and Hardening Guide
mirie_sd
0
1.4k
Using vROPs API with Swagger
mirie_sd
0
250
Cooking operations with Salt
mirie_sd
0
800
Blog vExperts use
mirie_sd
0
240
Other Decks in Technology
See All in Technology
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
440
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
110
Kiro Crewをはじめよう
kizawa2020
1
150
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
480
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
130
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
4
1.2k
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
430
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
ゲームのリアルタイム通信から見た QUIC と MoQ
segadevtech
0
120
SREでアラート疲れを 解決しよう!
kairim0
1
230
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
130
How to Design Configuration for Rails Applications
willnet
0
360
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Typedesign – Prime Four
hannesfritz
42
3.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
Optimising Largest Contentful Paint
csswizardry
37
4k
BBQ
matthewcrist
90
10k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
The untapped power of vector embeddings
frankvandijk
2
1.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
930
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Transcript
2020/10/21 VMware DevOps Meetup #6 @IrieMasahiro WebMKSで掴むVMコンソール
自己紹介 入江 正博 @IrieMasahiro • 某情報通信系企業 クラウド/インフラコンサルタント • VMUG 仮想インフラ部会
• vExpert 2019-2020
せっかくなのでお知らせ 開催日:2020年10月23日(金) 12:00~18:00 会場:オンライン ( Zoom ) https://VMware.zoom.us/j/98585424596 パスワードは前日までに登録された方にお知らせします. 参加費:無料
参加特典:USERCON 2020 オリジナルパーカー 登録方法:VMUG Event ページ右側の "RSVP" ボタンをクリックで参加登録できます. https://community.vmug.com/events/event-description?CalendarEventKey=1d49ee28-e059-45d1-8506-fa673ee43c8e VMUG usercon online 検 索
----- 閑話休題 -----
今更ですが… vSphere 7.0 GA! 時代は既に vSphere 7.0 U1 に突入…
数々のアップデート vSphere with Kubernetes vSphere LifeCycle Manager Identity Federation vSphere
Trust Authority スケーラビリティ拡大 VDS 7.0 vCenter Server Upgrade Plannner DRS 改善、vMotion 改善 and more...
出会いがあれば別れが…
出会いがあれば別れが…
出会いがあれば別れが… ESXi からの VNC サーバの削除…
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる TightVNC
Viewer で VM コンソールに接続
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる •
ESXi 側の Firewall を gdbserver でガバッと ポート指定の Config XML を作成し、VNC 接続用のポートを開放 $ cat /etc/vmware/firewall/vnc.xml <ConfigRoot> <service id='0050'> <id>VNC</id> <rule id='0000'> <direction>outbound</direction> <protocol>tcp</protocol> <porttype>dst</porttype> <port> <begin>5900</begin> <end>5910</end> </port> </rule> <rule id='0001'> <direction>inbound</direction> <protocol>tcp</protocol> 【略】 $ esxcli network firewall refresh # GUI のファイヤウォールでサービスとして現れる。
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる •
ESXi 側の Firewall を gdbserver でガバッと ポート指定の Config XML を作成し、VNC 接続用のポートを開放 • VM の設定パラメータとして vSphere Client で追加 or vmx ファイルに追記 – RemoteDisplay.vnc.enabled = “TRUE” – RemoteDisplay.vnc.port = “接続ポート(クラスタで VMユニーク)” – RemoteDisplay.vnc.password = “接続パスワード” – RemoteDisplay.vnc.keyMap = “jp”
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる •
ESXi 側の Firewall を gdbserver でガバッと ポート指定の Config XML を作成し、VNC 接続用のポートを開放。 • VM の設定パラメータとして vSphere Client で追加 or vmx ファイルに追記 – RemoteDisplay.vnc.enabled = “TRUE” – RemoteDisplay.vnc.port = “接続ポート(クラスタで VMユニーク)” – RemoteDisplay.vnc.password = “接続パスワード” – RemoteDisplay.vnc.keyMap = “jp”
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる •
ESXi 側の Firewall を gdbserver でガバッと ポート指定の Config XML を作成し、VNC 接続用のポートを開放 • VM の設定パラメータとして vSphere Client で追加 or vmx ファイルに追記 – RemoteDisplay.vnc.enabled = “TRUE” – RemoteDisplay.vnc.port = “接続ポート(クラスタで VMユニーク)” – RemoteDisplay.vnc.password = “接続パスワード” – RemoteDisplay.vnc.keyMap = “jp” • VM 疎通は関係なく、[ESXi アドレス]:[指定したポート] で コンソール接続可能
ESXi での VNC サーバ? • VNC クライアントで VM コンソールに接続できる •
ESXi 側の Firewall を gdbserver でガバッと ポート指定の Config XML を作成し、VNC 接続用のポートを開放 • VM の設定パラメータとして vSphere Client で追加 or vmx ファイルに追記 – RemoteDisplay.vnc.enabled = “TRUE” – RemoteDisplay.vnc.port = “接続ポート(クラスタで VMユニーク)” – RemoteDisplay.vnc.password = “接続パスワード” – RemoteDisplay.vnc.keyMap = “jp” • VM 疎通は関係なく、[ESXi アドレス]:[指定したポート] で コンソール接続可能 • vSphere Client 接続不要
ありがちなユースケース vSphere Client VM(コンソール) IT 管理部門 利用者部門 HTTPS SSH RDP
払い出し
ありがちなユースケース vSphere Client VM(コンソール) IT 管理部門 利用者部門 HTTPS SSH RDP
??? VM疎通取れなくなった! 復旧のためコンソール見たい! vSphere Client は他部門 VM も あるので渡したくない。 とは言え、こちらで復旧もやり たくないぁ… 払い出し
ありがちなユースケース vSphere Client VM(コンソール) IT 管理部門 利用者部門 HTTPS SSH RDP
払い出し VNC VM 疎通取れなくても作業可能 vSphere Client を渡さなくても 利用者部門で何とかなった。
かの有名 Product でも ※ HTML VNC Client https://github.com/novnc/noVNC 多分使っているはず…(実物までは見てない...)
そんな VNC サーバが vSphere 7.0 では削除
VNC サーバの後継としては
VNC サーバの後継としては 仮想マシンに VNC アクセスするユーザーは、WebSocket を介した VNC 接続を提供す る VirtualMachine.AcquireTicket
("webmks") API を使用する必要があります 。webmks チケットは、仮想マシン コンソールへの認証されたアクセスを提供します。 詳細については、『VMware HTML Console SDK のドキュメント』を参照してくだ さい。
WebMKS と VMware HTML Console SDK
WebMKS • MKS = Mouse, Keyboard, Screen の略らしい – “Unable
to connect to the MKS” でおなじみ – 902 番ポート • MKS を HTTPS(WebSocket) で扱う仕組み • vSphere 5.5 以降で利用可能 • HTTPS(wss) を使っているので SSL/TLS での暗号化通信 • vSphere (Web) Client や VMware Remote Console、 Host Client での コンソール表示は WebMKS
やはり、かの有名 Product も vSphere 7.0 対応なので (Web)MKS へ
VMware HTML Console SDK • WebMKS を取り扱うための SDK (JavaScript/CSS) –
https://code.vmware.com/web/sdk/2.1.0/html-console – プログラミングガイド • https://www.vmware.com/content/dam/digitalmarketing/vmwar e/ja/pdf/html-console-sdk-210-programming-guide.pdf • vSphere Client はコンソール表示にはコレを使っている – vCloud Director もコレらしい
None
実装方法 • プログラミングガイドより、基本はコレだけで動く <html> <body> <link rel="stylesheet" type="text/css" href="css/wmks-all.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="wmks.min.js"></script> <div id="wmksContainer" style="position: absolute; width: 100%; height: 100%;"></div> <script> var wmks = WMKS.createWMKS("wmksContainer",{}) .register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, function(event,data){ if(data.state == WMKS.CONST.ConnectionState.CONNECTED){ console.log("connection state change : connected");} }); wmks.connect("【WebMKS チケット URL】"); </script> </body> </html>
実装方法 • プログラミングガイドより、基本はコレだけで動く
実装方法 • プログラミングガイドより、基本はコレだけで動く <html> <body> <link rel="stylesheet" type="text/css" href="css/wmks-all.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="wmks.min.js"></script> <div id="wmksContainer" style="position: absolute; width: 100%; height: 100%;"></div> <script> var wmks = WMKS.createWMKS("wmksContainer",{}) .register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, function(event,data){ if(data.state == WMKS.CONST.ConnectionState.CONNECTED){ console.log("connection state change : connected");} }); wmks.connect("【WebMKS チケット URL】"); </script> </body> </html>
WebMKS チケット? • WebMKS 接続用 WebSocket のワンショット URL – wss://【ESXiホスト】:【ポート】/ticket/【Token的なもの】の形式
– 同じ URL への 2 回目以降の接続は 503 • vSphere API から取得 – VirtualMachine.AquireTicket(“webmks”) • *vmomi での作りこみ • govc でも可能に? (https://github.com/vmware/govmomi/issues/2083) – どうしても GUI で…という場合は MOB から • vSphere 7.0 からは REST API でも取得可能に – https://【vCenter】/rest/vcenter/【VM の MOID】/console/tickets – JavaScript で叩けばブラウザのみで完結? • そもそもブラウザから叩くのは CORS で無理っぽい… – vCSA の http サーバのレスポンスヘッダをいじれれば? (imkk • vSphere Client は見なくていいが、ログインは必要
実装するならこんな感じ…? 利用者 ①HTTPS WebMKS コンソール チケット取得用 自前 API vCenter/ESXi ②HTTP(S)
Ticket取得 ③HTTPS Ticket取得 ⑤Ticket応答 ④Ticket応答 ⑥WebSocket WenMKS接続
まとめ • vSphere 7.0 から ESXi での VNC サーバが削除 –
VM 利用者に vSphere Client を開放していない運用の場合は注意 • VNC 無き今、VM コンソールの取得は VMware HTML Console SDK を使った WebMKS で – WebSocket 版の MKS – JavaScript/CSS の SDK で凝らなければ接続は簡単 • WebMKS 経由の場合、WebMKS チケット取得が必要 – チケット取得のためにログインは必要 – CLI 経由で取得 or 自前で API 立ててブラウザ取得
EOP