Skip to main content
add missing procedure for creating config.vmdk from config.img.
Source Link
Johannes Ernst
  • 1.3k
  • 4
  • 18
  • 37

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info - the.

  • The .vmdk image file for this second hard drive can be created using the following commands, if you are on a Linux distro that uses apt:

     sudo apt-get install qemu-kvm
     qemu-img convert -O vmdk  config.img config.vmdk
    

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info - the .vmdk image file for this second hard drive can be created using the following commands:

     sudo apt-get install qemu-kvm
     qemu-img convert -O vmdk  config.img config.vmdk
    

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info.

  • The .vmdk image file for this second hard drive can be created using the following commands, if you are on a Linux distro that uses apt:

     sudo apt-get install qemu-kvm
     qemu-img convert -O vmdk  config.img config.vmdk
    
add missing procedure for creating config.vmdk from config.img.
Source Link

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info - the .vmdk image file for this second hard drive can be created using the following commands:

     sudo apt-get install qemu-kvm
     qemu-img convert -O vmdk  config.img config.vmdk
    

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info.

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info - the .vmdk image file for this second hard drive can be created using the following commands:

     sudo apt-get install qemu-kvm
     qemu-img convert -O vmdk  config.img config.vmdk
    
added 34 characters in body
Source Link
0xC0000022L
  • 7.2k
  • 10
  • 53
  • 90

I figured it out and blogged about it here: http://indieboxproject.org/blog/2014/10/virtualbox-and-cloud-init/here. From that (now dead) link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info.

I figured it out and blogged about it here: http://indieboxproject.org/blog/2014/10/virtualbox-and-cloud-init/. From that (now dead) link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info.

I figured it out and blogged about it here. From that link:

#VirtualBox and cloud-init

In case somebody else wants to know:

  • You can use cloud-init to configure VirtualBox virtual machines without too much trouble.

  • One way of doing this is to use a “config drive”, i.e. to mount another virtual hard drive that (only) has the cloud-init configuration data on it.

  • Here’s a way of creating it:

      # Create empty virtual hard drive file
      dd if=/dev/zero of=config.img bs=1 count=0 seek=2M
      # put correct filesystem and disk label on
      mkfs.vfat -n cidata config.img
      # mount it somewhere so you can put the config data on
      sudo mount config.img /mnt
    
  • Now put your config data into /mnt/user-data and /mnt/meta-data,

  • Example: /mnt/user-data. This will create a user ubos-admin with a ssh key so you can log on via ssh without a password.

      #cloud-config
      users:
       - name: ubos-admin
         gecos: UBOS administrative user
         ssh-authorized-keys:
          - insert ssh key here
         sudo: "ALL=(ALL) NOPASSWD: /usr/bin/ubos-admin *, /usr/bin/bash *"
    
  • Example /mnt/meta-data:

      instance-id: my-instance-1
    
  • Then, unmount:

      sudo umount /mnt
    
  • and attach as second hard drive before you boot. If cloud-init is installed in the main image, it should pick up the configuration info.

Added answer contents from dead link, h/t archive.org link in the comments
Source Link
Loading
Source Link
Johannes Ernst
  • 1.3k
  • 4
  • 18
  • 37
Loading