How do I login to Ubuntu’s cloud image?

2023-03-27 Thread Jeremy Hansen
I’m trying to setup a template for Ubuntu 22.04LTS and while the image boots 
successfully, I see no way to log in. It doesn’t seem to bring up networking by 
default so I can’t ssh in with my pub key.

Is this where “User Data” comes in to play? If so, anyone have an example that 
sets the password or just brings up networking?

Thanks!



signature.asc
Description: PGP signature


Re: How do I login to Ubuntu’s cloud image?

2023-03-27 Thread Nux
Don't think their cloud image supports Cloudstack out of the box, extra 
configuration is required.


Assuming you are on Linux right now, download the KVM image, add the 
config and copy it into the image using virt-copy-in (from libguestfs 
program), ie:
wget 
https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img
wget -O 99_cloudstack.cfg https://pastebin.com/raw/v9BW3Pki # modify 
this accordingly, if required, eg default user for ssh login is "ubuntu"
virt-copy-in -a jammy-server-cloudimg-amd64-disk-kvm.img 
99_cloudstack.cfg /etc/cloud/cloud.cfg.d/


Or just register the image I just modified and uploaded here, completely 
untested btw, so feedback is appreciated:

http://dl.openvm.eu/tmp/jammy-server-cloudimg-amd64-disk-kvm.qcow2.bz2

HTH

On 2023-03-27 17:13, Jeremy Hansen wrote:

I’m trying to setup a template for Ubuntu 22.04LTS and while the
image boots successfully, I see no way to log in. It doesn’t seem to
bring up networking by default so I can’t ssh in with my pub key.

Is this where “User Data” comes in to play?  If so, anyone have an
example that sets the password or just brings up networking?

Thanks!

 [1]



Links:
--
[1] https://canarymail.io


Re: How do I login to Ubuntu’s cloud image?

2023-03-27 Thread Stephan Bienek
Hi Jeremy,

the last ubuntu cloud image i was using
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
was working with Cloudstack User-Data out of the box, without any modifications.

Make sure to use

Advanced mode / Show advanced settings / Userdata /( Manual Userdata entry / in 
case of cloudstack 4.18)

and paste your cloud-init config, for example ("#cloud-config" line is 
required):

#cloud-config
users:
  - name: stephan
ssh-authorized-keys:
  - ssh-ed25519 
lock_passwd: false
passwd: 
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_pwauth: true

Are you really sure networking was not brought up?
Make sure to use an Isolated network with a Virtual Router or any other network 
with "Config Drive" feature enabled.
Networking is working without userdata - if this doesnt work you can give Nux 
idea a try to be 100% sure.

Cheers,
Stephan


> Jeremy Hansen  hat am 27.03.2023 18:13 CEST 
> geschrieben:
> 
> 
> I’m trying to setup a template for Ubuntu 22.04LTS and while the image boots 
> successfully, I see no way to log in. It doesn’t seem to bring up networking 
> by default so I can’t ssh in with my pub key.
> 
> Is this where “User Data” comes in to play? If so, anyone have an example 
> that sets the password or just brings up networking?
> 
> Thanks!
> 
> 
>


Re: How do I login to Ubuntu’s cloud image?

2023-03-27 Thread Jeremy Hansen
So none of the UserData stuff seems to work for me. I cut and pasted this in to 
the manual userdata area and I really can’t tell if it’s doing anything at all. 
I’m setting for a user and supplying a password hash and I’m unable to log in 
on the console.

I’m specifically using 
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
 and as far as I can tell, when it boots, network isn’t coming up because I see 
nothing in DHCP that it’s asking for an ip address. As opposed to Rocky 9.1 
qcow images which seem to work just fine out of the box. Network comes up, I 
log in with my ssh key. No issue.

@Nux, I tried your image, but it didn’t boot. I see the
GRUB_FORCE_PARTUUID set, attempting initrdless boot.
error and it just halts.

I saw this when I was initially attempting to create the Ubuntu template. 
Logically you would think the -kvm.img would indicate a qcow2 kvm image, but 
this wouldn’t boot for me. The 
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
 seems to boot just fine.

Thanks
-jeremy

> On Monday, Mar 27, 2023 at 11:54 AM, Stephan Bienek  (mailto:stephan@bienek.org)> wrote:
> Hi Jeremy,
>
> the last ubuntu cloud image i was using
> https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
> was working with Cloudstack User-Data out of the box, without any 
> modifications.
>
> Make sure to use
>
> Advanced mode / Show advanced settings / Userdata /( Manual Userdata entry / 
> in case of cloudstack 4.18)
>
> and paste your cloud-init config, for example ("#cloud-config" line is 
> required):
>
> #cloud-config
> users:
> - name: stephan
> ssh-authorized-keys:
> - ssh-ed25519 
> lock_passwd: false
> passwd: 
> sudo: ALL=(ALL) NOPASSWD:ALL
> shell: /bin/bash
> ssh_pwauth: true
>
> Are you really sure networking was not brought up?
> Make sure to use an Isolated network with a Virtual Router or any other 
> network with "Config Drive" feature enabled.
> Networking is working without userdata - if this doesnt work you can give Nux 
> idea a try to be 100% sure.
>
> Cheers,
> Stephan
>
>
> > Jeremy Hansen  hat am 27.03.2023 18:13 CEST 
> > geschrieben:
> >
> >
> > I’m trying to setup a template for Ubuntu 22.04LTS and while the image 
> > boots successfully, I see no way to log in. It doesn’t seem to bring up 
> > networking by default so I can’t ssh in with my pub key.
> >
> > Is this where “User Data” comes in to play? If so, anyone have an example 
> > that sets the password or just brings up networking?
> >
> > Thanks!
> >
> >
> >


signature.asc
Description: PGP signature


Re: How do I login to Ubuntu’s cloud image?

2023-03-28 Thread Nux

Might be UEFI.

On 2023-03-27 22:34, Jeremy Hansen wrote:

So none of the UserData stuff seems to work for me.  I cut and pasted
this in to the manual userdata area and I really can’t tell if
it’s doing anything at all.  I’m setting for a user and supplying
a password hash and I’m unable to log in on the console.

I’m specifically using
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
and as far as I can tell, when it boots, network isn’t coming up
because I see nothing in DHCP that it’s asking for an ip address.
As opposed to Rocky 9.1 qcow images which seem to work just fine out
of the box.  Network comes up, I log in with my ssh key.  No issue.

@Nux, I tried your image, but it didn’t boot.  I see the
GRUB_FORCE_PARTUUID set, attempting initrdless boot.
error and it just halts.

I saw this when I was initially attempting to create the Ubuntu
template.  Logically you would think the -kvm.img would indicate a
qcow2 kvm image, but this wouldn’t boot for me.  The
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
seems to boot just fine.

Thanks
-jeremy


On Monday, Mar 27, 2023 at 11:54 AM, Stephan Bienek
 wrote:

Hi Jeremy,

the last ubuntu cloud image i was using


https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img


was working with Cloudstack User-Data out of the box, without any
modifications.

Make sure to use

Advanced mode / Show advanced settings / Userdata /( Manual Userdata
entry / in case of cloudstack 4.18)

and paste your cloud-init config, for example ("#cloud-config" line
is required):

#cloud-config
users:
- name: stephan
ssh-authorized-keys:
- ssh-ed25519 
lock_passwd: false
passwd: 
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_pwauth: true

Are you really sure networking was not brought up?
Make sure to use an Isolated network with a Virtual Router or any
other network with "Config Drive" feature enabled.
Networking is working without userdata - if this doesnt work you can
give Nux idea a try to be 100% sure.

Cheers,
Stephan


Jeremy Hansen  hat am 27.03.2023 18:13
CEST geschrieben:

I’m trying to setup a template for Ubuntu 22.04LTS and while the
image boots successfully, I see no way to log in. It doesn’t
seem to bring up networking by default so I can’t ssh in with my
pub key.

Is this where “User Data” comes in to play? If so, anyone have
an example that sets the password or just brings up networking?

Thanks!