Download Debian –
- Go to https://cloud.debian.org/images/cloud/OpenStack/9.13.7-20201108/
- Download debian-9.13.7-20201108-openstack-amd64.qcow2
Upload Debian to Oracle Cloud Infrastructure –
- Login to your OCI Console, for instance, https://console.us-ashburn-1.oraclecloud.com/
- Go to Object Storage and pick or create a bucket
- Upload debian-9.13.7-20201108-openstack-amd64.qcow2 to the bucket
Import Debian Custom Image –
- Login to your OCI Console, for instance, https://console.us-ashburn-1.oraclecloud.com/
- Go to Compute -> Custom Images and click on Import Image
- Select Import from Object Storage Bucket option
- Select the right bucket and then the uploaded debian image object
- Select Image Type as QCOW2
- Select Paravirtualized Mode
- Click on Import
Create VM on OCI using Debian Custom Image –
- Login to your OCI Console, for instance, https://console.us-ashburn-1.oraclecloud.com/
- Go to Compute -> Instances and click on Create Instance
- Click on Change Image, go to Custom Image tab
- Select the imported Debian image
- For the purpose of this tutorial, assign a public IP
- Generate new key pair or use an existing one
- Click on Create
Logging in to Debian VM on OCI –
- Sample Windows PowerShell ssh command –
ssh -i 'C:\Users\Amrita\debian\ssh-key-2020-11-12.key' debian@<public IP>
- If OpenSSH is not installed, do the following –
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Comment if you face any issues.
I just want to say thank you. You helped me a lot.
Glad to hear it!
Thanks for this post, with some changes (see below) it worked perfectly!
Notes/changes:
1. The location of the Debian images has moved. The images are now available here: https://cloud.debian.org/images/cloud/ – for our purposes I selected the “genericcloud” one.
2. If you have created a private bucket or are re-using an existing one which is private, it is crucial that you go to the bucket -> Objects -> navigate to your qcow2 image -> click on the three dots and select “Create pre-authenticated request”. Then copy that URL and in the Create image UI select “Import from an Object Storage URL”, then paste the previously shown URL there. Everything else is the same. Without this, the import fails with an authorization error.
Thank you, Andreas. I am sure others will find this valuable!
I executed that approach, but the connection to VM not works using ssh, i have a prompt in a console connection where it’s requesting add login and password?
Hi Andreas, thank you for the post. I followed the instructions but I can’t connect to my Debian 10 (buster) installation.
When trying to SSH into it, I get “Connection closed by XXXXXXX port 22”. (I run several other VMs, both Windows and “Red Hat” Linux without any issue.)
I can connect to the VM using Oracle Console (Cloud Shell), but is asks for a user and password and I don’t have one. I tried every “default” combination but I can’t login.
Any idea what could be wrong?
Any help is appreciated. Thanks!