Skip to content

Commit 3c95b9c

Browse files
committed
Add VNC support
Crude support for VNC - none of the settings can be customised but something accessible to Virt manager is now available
1 parent b3a6557 commit 3c95b9c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
interfaces: "{{ vm.interfaces | default([], true) }}"
3737
start: "{{ vm.start | default(true) }}"
3838
autostart: "{{ vm.autostart | default(true) }}"
39+
enable_vnc: "{{ vm.enable_vnc | default(false) }}"
3940
with_items: "{{ libvirt_vms }}"
4041
loop_control:
4142
loop_var: vm

templates/vm.xml.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@
6868
<console type='pty'>
6969
<target type='serial' port='0'/>
7070
</console>
71+
{% endif %}
72+
{% if enable_vnc %}
73+
<graphics type='vnc' port='5906' autoport='yes' listen='127.0.0.1'>
74+
<listen type='address' address='127.0.0.1'/>
75+
</graphics>
76+
<video>
77+
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
78+
<alias name='video0'/>
79+
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
80+
</video>
7181
{% endif %}
7282
</devices>
7383
</domain>

0 commit comments

Comments
 (0)