mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
feat: add websocket graphics config (#1672)
This adds websocket functionality for VNC. The websocket attribute may be used to specify the port to listen on (with -1 meaning auto-allocation and autoport having no effect due to security reasons).
This commit is contained in:
@@ -66,13 +66,15 @@ describe VagrantPlugins::ProviderLibvirt::Action::CreateDomain do
|
||||
let(:vagrantfile_providerconfig) do
|
||||
<<-EOF
|
||||
libvirt.graphics_port = 5900
|
||||
libvirt.graphics_websocket = 5700
|
||||
EOF
|
||||
end
|
||||
|
||||
it 'should emit the graphics port' do
|
||||
it 'should emit the graphics port and websocket' do
|
||||
expect(servers).to receive(:create).and_return(machine)
|
||||
expect(volumes).to_not receive(:create) # additional disks only
|
||||
expect(ui).to receive(:info).with(' -- Graphics Port: 5900')
|
||||
expect(ui).to receive(:info).with(' -- Graphics Websocket: 5700')
|
||||
|
||||
expect(subject.call(env)).to be_nil
|
||||
end
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'>
|
||||
</input>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='127.0.0.1' keymap='en-us'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='16384' heads='1'/>
|
||||
</video>
|
||||
|
||||
@@ -344,7 +344,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::StartDomain do
|
||||
expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, launched_domain_xml)
|
||||
expect(libvirt_domain).to receive(:autostart=)
|
||||
expect(domain).to receive(:start)
|
||||
expect(ui).to receive(:info).with(' -- Graphics Port: 5900')
|
||||
expect(ui).to receive(:info).with(' -- Graphics Port: 5900')
|
||||
|
||||
expect(subject.call(env)).to be_nil
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'/>
|
||||
<video>
|
||||
<model heads='1' type='cirrus' vram='16384'/>
|
||||
</video>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us' websocket='-1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<audio id='1' type='none'/>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<input bus='ps2' type='keyboard'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'>
|
||||
<listen address='127.0.0.1' type='address'/>
|
||||
</graphics>
|
||||
<audio id='1' type='none'/>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<input bus='ps2' type='keyboard'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket="-1">
|
||||
<listen address='127.0.0.1' type='address'/>
|
||||
</graphics>
|
||||
<audio id='1' type='none'/>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<input bus='ps2' type='keyboard'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'>
|
||||
<listen address='127.0.0.1' type='address'/>
|
||||
</graphics>
|
||||
<audio id='1' type='none'/>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</console>
|
||||
<input bus='ps2' type='mouse'/>
|
||||
<input bus='ps2' type='keyboard'/>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
|
||||
<graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc' websocket='-1'>
|
||||
<listen address='127.0.0.1' type='address'/>
|
||||
</graphics>
|
||||
<audio id='1' type='none'/>
|
||||
|
||||
Reference in New Issue
Block a user