<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ubuntu 24.04 Cloud Image Template Not Working]]></title><description><![CDATA[<p dir="auto">I have followed this guide <a href="https://xen-orchestra.com/blog/debian-cloud-template-for-xenserver/" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/blog/debian-cloud-template-for-xenserver/</a></p>
<p dir="auto">to create Ubuntu 24.04 cloud image template, all looks good from the guide and all even on Ubuntu 24.04 but when i create a VM from the template, the cloudinit is not working</p>
<p dir="auto">anyone been able to create cloud image template for Ubuntu 24.04 on XCP-ng?</p>
]]></description><link>https://xcp-ng.org/forum/topic/10086/ubuntu-24-04-cloud-image-template-not-working</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 01:30:47 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/10086.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Dec 2024 00:00:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 20:11:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a> said in <a href="/forum/post/86635">Ubuntu 24.04 Cloud Image Template Not Working</a>:</p>
<blockquote>
<p dir="auto">did you mount the guest tools cdrom to the cloud image before you created a template from it?</p>
</blockquote>
<p dir="auto">No, I just make my base images  (for the end template) as generic as possible, and I do all mounts, package installs, accounts, keys, including the xe-guest utils package all in the user-data config for cloud-init.  Makes the configurations more uniform across all stacks I have to maintain and scales really well with jinja templates.</p>
<blockquote>
<p dir="auto">also what is point of {name}% in below? can you explain? where does it get {name} from and what is % use?</p>
</blockquote>
<p dir="auto">That pulls the hostname from metadata that is provided by the nocloud datasource.</p>
<p dir="auto">If you ever want to see all the metadata available (for example, say your provisioning plane does dynamic configuration from some backend IAS platform, and you need logic that renders metadata to run different configurations;  run the following after login:</p>
<pre><code>cloud-init query -a
</code></pre>
<p dir="auto">For example, I run different configurations based on what the 'distro' value is -<br />
example:</p>
<pre><code>cloud-init query -f {{v1.distro}}
</code></pre>
<pre><code>{% if distro in ['rocky', 'ol', 'centos', 'fedora', 'redhat', 'almalinux'] -%}
//do the rpm things//
</code></pre>
<p dir="auto">This allows us to run completely different configuration settings based on what distro its being run in, or even what virtualization platform it is running on. Some platforms won't use the hostname, or fqdn meta values, so I have some if logic that only adds it when vendordata is null, example;</p>
<pre><code>{% if vendordata == '' %}
fqdn: {name}
{% endif %}
</code></pre>
<p dir="auto">Probably more than you wanted to know,  but that's a brief summary of cloud-init metadata.</p>
]]></description><link>https://xcp-ng.org/forum/post/86644</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86644</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 20:11:07 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 19:48:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dj423" aria-label="Profile: dj423">@<bdi>dj423</bdi></a></p>
<p dir="auto">yeah was able to get ther networking working fine using the v1 also</p>
<p dir="auto">thanks</p>
<p dir="auto">am all good now, only other thing which am not really interested in as i prefer to create each VM one a time even if i need multiple</p>
<p dir="auto"><a href="https://xcp-ng.org/forum/topic/10089/dynamic-cloudinit-network-config-feature-request">https://xcp-ng.org/forum/topic/10089/dynamic-cloudinit-network-config-feature-request</a></p>
]]></description><link>https://xcp-ng.org/forum/post/86643</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86643</guid><dc:creator><![CDATA[encryptblockr]]></dc:creator><pubDate>Sun, 08 Dec 2024 19:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 19:43:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">For reference, if you are testing network configs, here is a basic static ip v1 example I use to configure all distros, debian, ubuntu, RHEL, Rocky, Alma, Oracle linux, etc.</p>
<pre><code>network:
  version: 1
  config:
    - type: physical
      name: enX0
      subnets:
        - type: static
          address: 192.168.0.xx/24
          gateway: 192.168.0.1
    - type: nameserver
      address:
        - 192.168.0.1
        - 192.168.90.50
      search:
        - example.tld
</code></pre>
<p dir="auto">Works very well for me, as I am lazy and want to do as little manual configuration as possible, and XCP-ng and XO make that so easy.  Most ENI, network-manager, systemd-networkd, netplan network stacks render this config fine.  FYI</p>
]]></description><link>https://xcp-ng.org/forum/post/86642</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86642</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 19:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 19:36:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a><br />
Oh good! Glad you got it working.</p>
<p dir="auto">Keep in mind for those 'public' cloud images, (for anyone that uses them)  you can have cloud-init install the xe guest utils at initialization as long as you have the guest-tools.iso mounted at bootup in the console within xo;</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1733686267039-d6feb452-ed0f-4e96-a990-d4d979d926a0-image.png" alt="d6feb452-ed0f-4e96-a990-d4d979d926a0-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Sounds like you are getting the hang of it. Best of luck!</p>
]]></description><link>https://xcp-ng.org/forum/post/86641</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86641</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 19:36:14 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 16:10:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dj423" aria-label="Profile: dj423">@<bdi>dj423</bdi></a></p>
<p dir="auto">just seeing your response now as i was trying to post new update</p>
<p dir="auto">so i imported a new VM and made sure i mounted the guest-tools iso to it before converting it to template</p>
<p dir="auto">i just tried this and it worked!!!</p>
<pre><code>#cloud-config
hostname: someotheruser
ssh_authorized_keys:
  - ssh-rsa AAAAxxx
  - ssh-rsa AAAAxxx
  - ssh-ed25519 AAAAxxx
runcmd:
  - [mkdir, -p, /mnt/guest-tools]
  - [mount, /dev/cdrom, /mnt/guest-tools]
  - [bash, /mnt/guest-tools/Linux/install.sh]
  - [umount, /dev/cdrom]
  - [rm, -rf, /mnt/guest-tools]
</code></pre>
<p dir="auto">thanks for all your help, i think am good now!!!</p>
]]></description><link>https://xcp-ng.org/forum/post/86638</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86638</guid><dc:creator><![CDATA[encryptblockr]]></dc:creator><pubDate>Sun, 08 Dec 2024 16:10:36 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 15:56:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">Just add the commands to your cloud config in user-data;</p>
<pre><code>runcmd:
  - mount /dev/cdrom /mnt
  - bash /mnt/Linux/install.sh
  - umount /dev/cdrom

</code></pre>
]]></description><link>https://xcp-ng.org/forum/post/86637</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86637</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 15:56:11 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 15:49:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dj423" aria-label="Profile: dj423">@<bdi>dj423</bdi></a></p>
<p dir="auto">ok i got the cloud configs to work now and i can ssh in fine</p>
<p dir="auto">one last thing i want to know is how do i add the guest tools to the cloud image?</p>
<p dir="auto">did you mount the guest tools cdrom to the cloud image before you created a template from it?</p>
<p dir="auto">can you share how you can add guest tools to the VM created from the cloud template at bootup?</p>
<p dir="auto">thanks</p>
<p dir="auto">here is cloud config that works</p>
<pre><code>#cloud-config
hostname: someotheruser
ssh_authorized_keys:
  - ssh-rsa AAAAxxx
  - ssh-rsa AAAAxxx
  - ssh-ed25519 AAAAxxx
</code></pre>
<p dir="auto">so how do i add installing guest tools?</p>
<p dir="auto">when i tried to install via apt, here is what happened<br />
<a href="https://xcp-ng.org/forum/topic/10088/how-to-install-guest-tools-via-apt">https://xcp-ng.org/forum/topic/10088/how-to-install-guest-tools-via-apt</a></p>
]]></description><link>https://xcp-ng.org/forum/post/86635</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86635</guid><dc:creator><![CDATA[encryptblockr]]></dc:creator><pubDate>Sun, 08 Dec 2024 15:49:18 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 14:44:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">You are using version 2 of your network config, did you happen to install netplanio package to consume your version 2 config, and is it enabled in the image you created?  Otherwise, I have better luck with the version 1 network configs.</p>
]]></description><link>https://xcp-ng.org/forum/post/86634</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86634</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 14:44:14 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 14:35:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">Pretty sure you want the 'nocloud' data source as well.  You can have cloud-init mount and install the xe guest tools if the virtual cd is attached at bootup.</p>
]]></description><link>https://xcp-ng.org/forum/post/86633</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86633</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 14:35:29 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 19:49:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">I don't see your users block in that config</p>
<p dir="auto">Example:</p>
<pre><code>users:
## Add users
  - name: user1
    groups: sudo
    lock_passwd: false
    passwd: $6$xxxx.......
    ssh_authorized_keys:
      - ssh-ed25519 &lt;my-key-ed25519&gt;
</code></pre>
<p dir="auto">So that may be an issue. See my examples for a guide.</p>
]]></description><link>https://xcp-ng.org/forum/post/86632</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86632</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 19:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 14:25:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dj423" aria-label="Profile: dj423">@<bdi>dj423</bdi></a></p>
<p dir="auto">one issue with the cloud images is that one cant setup the guestools on them baked into the image</p>
<p dir="auto">that is issue</p>
<p dir="auto">so every VM i create i have to install the guest tools on all of them</p>
<p dir="auto">all good though since its pretty quick setup but would be great to have them install at bootstrap</p>
<p dir="auto">or cna one install it with the cloud config? that might be possible actually but never tried that</p>
]]></description><link>https://xcp-ng.org/forum/post/86631</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86631</guid><dc:creator><![CDATA[encryptblockr]]></dc:creator><pubDate>Sun, 08 Dec 2024 14:25:04 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 14:05:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dj423" aria-label="Profile: dj423">@<bdi>dj423</bdi></a></p>
<p dir="auto">i will try using the cloud images as base now</p>
<p dir="auto">what i used originally was the regular ISO here</p>
<ul>
<li><a href="https://isos.ubuntu.mirror.constant.com/24.04.1/" target="_blank" rel="noopener noreferrer nofollow ugc">https://isos.ubuntu.mirror.constant.com/24.04.1/</a></li>
</ul>
<p dir="auto">and i used this one for 24.04 lts</p>
<ul>
<li><a href="https://isos.ubuntu.mirror.constant.com/24.04.1/ubuntu-24.04.1-live-server-amd64.iso" target="_blank" rel="noopener noreferrer nofollow ugc">https://isos.ubuntu.mirror.constant.com/24.04.1/ubuntu-24.04.1-live-server-amd64.iso</a></li>
</ul>
<p dir="auto">i pretty much followed the guide i mentioned</p>
<p dir="auto">after i have the Ubuntu OS installed<br />
i made sure to use <code>ubuntu</code> as user</p>
<p dir="auto">i sshed in, sudo to root user and ran the following commands</p>
<pre><code>ubuntu@ubuntu:~$ sudo -i
[sudo] password for ubuntu:
root@ubuntu:~#
root@ubuntu:~# mount /dev/cdrom /mnt
root@ubuntu:~# bash /mnt/Linux/install.sh
root@ubuntu:~# umount /dev/cdrom
root@ubuntu:~# apt install -y cloud-init cloud-initramfs-growroot
</code></pre>
<p dir="auto">then went to <code>/etc/cloud/cloud.cfg</code> but i did not have anything to change as i am ok with the defaults</p>
<p dir="auto">then</p>
<pre><code>root@alien:~# dpkg-reconfigure cloud-init

</code></pre>
<p dir="auto">and made sure to only have the ConfigDrive checked</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1733666322081-dc2b16c7-52bd-46a2-8fab-e7d595cccd94-image.png" alt="dc2b16c7-52bd-46a2-8fab-e7d595cccd94-image.png" class=" img-fluid img-markdown" /> ![1b65d665-e3c9-4214-858b-51d20192ffef-image.png](Input file contains unsupported image format)</p>
<p dir="auto">then ran this command next</p>
<pre><code>passwd -l root
</code></pre>
<p dir="auto">shut down the VM and converted to template</p>
<p dir="auto">and here are my cloud init settings when creating a VM from the template</p>
<blockquote>
<p dir="auto">cloud config</p>
</blockquote>
<pre><code>#cloud-config
hostname: someotheruser
ssh_authorized_keys:
  - ssh-rsa AAAAxxx
  - ssh-rsa AAAAxxx
  - ssh-ed25519 AAAAxxx
</code></pre>
<blockquote>
<p dir="auto">network config</p>
</blockquote>
<pre><code>network:
  version: 2
  ethernets:
    eth0:
      dhcp4: false
      #dhcp6: false
      addresses:
        - 10.1.1.10/24
        #- 4612:::/72
      gateway4: 10.1.1.1
      #gateway6: 4612:::0
      nameservers:
        addresses:
          - 1.1.1.1 
          - 8.8.8.8
          #- 2606:4700:4700::1111
          #- 2001:4860:4860::8888
</code></pre>
<h1>What does not work?</h1>
<p dir="auto">when i create a VM from the template, it does not create the user from my cloud config and nothing from my network config</p>
<p dir="auto">instead it boots up with original ip of the VM before i create d a template form it, meaning it does not work</p>
]]></description><link>https://xcp-ng.org/forum/post/86630</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86630</guid><dc:creator><![CDATA[encryptblockr]]></dc:creator><pubDate>Sun, 08 Dec 2024 14:05:19 GMT</pubDate></item><item><title><![CDATA[Reply to Ubuntu 24.04 Cloud Image Template Not Working on Sun, 08 Dec 2024 13:11:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/encryptblockr" aria-label="Profile: encryptblockr">@<bdi>encryptblockr</bdi></a></p>
<p dir="auto">That guide may be a bit outdated.   I would suggest following the guide I have posted over at <a href="https://xcp-ng.org/forum/topic/6821/cloud-init-success/3">https://xcp-ng.org/forum/topic/6821/cloud-init-success/3</a>  for more recent noble/jammy cloud images.</p>
<p dir="auto">and if you can, use the cloud images provided by ubuntu/canonical as the base. Over here: <a href="https://cloud-images.ubuntu.com/noble/current/" target="_blank" rel="noopener noreferrer nofollow ugc">https://cloud-images.ubuntu.com/noble/current/</a></p>
<p dir="auto">Can you provide any details on what didn't work?   If you need to generate the base image from scratch, I can help but that is a bit more involved and challenging.  Much better to go with the pre-canned cloud images when possible.</p>
]]></description><link>https://xcp-ng.org/forum/post/86629</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/86629</guid><dc:creator><![CDATA[dj423]]></dc:creator><pubDate>Sun, 08 Dec 2024 13:11:34 GMT</pubDate></item></channel></rss>