# Getting Error on flash .img file (ubuntu 18.04 X86) generated using mender\_convert latest tool

**URL:** <https://hub.mender.io/t/getting-error-on-flash-img-file-ubuntu-18-04-x86-generated-using-mender-convert-latest-tool/2781>\
**Category:** General Discussions\
**Tags:** ubuntu, x86, mender-convert\
**Created:** [November 5, 2020, 6:38am UTC](https://hub.mender.io/t/getting-error-on-flash-img-file-ubuntu-18-04-x86-generated-using-mender-convert-latest-tool/2781 "2020-11-05T06:38:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohita83](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/rohita83/32/436_2.png) [@Rohita83](https://hub.mender.io/u/Rohita83)\
**Post date:** [November 5, 2020, 6:38am UTC](https://hub.mender.io/t/getting-error-on-flash-img-file-ubuntu-18-04-x86-generated-using-mender-convert-latest-tool/2781/1 "2020-11-05T06:38:47Z")

</div>

@mirzak, @drewmoseley  
Note: Previous mender\_convert version 2.0 I followed the same steps and it was successful.

**Steps that I had followed** :

1. Downloaded tool  
[https://github.com/mendersoftware/mender-convert/tree/2.2.x](https://github.com/mendersoftware/mender-convert/tree/2.2.x)

2. cd mender-convert

3. created generic-x86\_64 at path “mender-convert/configs/generic-x86\_64”  
MENDER\_STORAGE\_DEVICE=/dev/sda  
MENDER\_DEVICE\_TYPE=“generic-x86\_64”  
MENDER\_STORAGE\_TOTAL\_SIZE\_MB=“24000”  
MENDER\_BOOT\_PART\_SIZE\_MB=“512”  
MENDER\_DATA\_PART\_SIZE\_MB=“2000”

4. mkdir -p input & cd input

5. copy ubuntu18.04 .img into input folder

6. convert virtual box .vhd to .img file  
sudo VBoxManage clonehd \<path to .vhd file of Virtual box Ubuntu 18.04\> \<.img destination file path\> --format raw

7. sudo su

8. Execute ./docker-build

9. Generate Mender Artifact image file (.mender) and golden SD card Image file (.img similar to .sdimg) from Ubuntu 18.04 raw image (.img) file by entering below command.  
MENDER\_ARTIFACT\_NAME=release-1 ./docker-mender-convert --disk-image input/\<.img file created in previous Section:Create Raw Ubuntu 18.04 Image\> --config configs/generic-x86\_64

10. fdisk -l -u \<.img golden image filename\>

11. Mount SD image partition & Edit grub configuration file with below commands.  
 sudo mkdir /mnt/boot sudo mount -o loop,offset=((512\*16384)) \<.img golden image file-path\> /mnt/boot cd /mnt/boot/EFI/BOOT/  
$ sudo gedit grub.cfg

Replace mender\_grub\_storage\_device=hd0 in grub.cfg.  
grub\_storage=${root}

if [“$grub\_storage” == “hd0,msdos1”]; then  
mender\_grub\_storage\_device=hd0  
elif [“$grub\_storage” == “hd1,msdos1”]; then  
mender\_grub\_storage\_device=hd1  
elif [“$grub\_storage” == “hd2,msdos1”]; then  
mender\_grub\_storage\_device=hd2  
elif [“$grub\_storage” == “hd3,msdos1”]; then  
mender\_grub\_storage\_device=hd3  
elif [“$grub\_storage” == “hd4,msdos1”]; then  
mender\_grub\_storage\_device=hd4  
elif [“$grub\_storage” == “hd5,msdos1”]; then  
mender\_grub\_storage\_device=hd5  
elif [“$grub\_storage” == “hd6,msdos1”]; then  
mender\_grub\_storage\_device=hd6  
elif [“$grub\_storage” == “hd7,msdos1”]; then  
mender\_grub\_storage\_device=hd7  
fi

1. Assign kernel\_imagetype and initrd\_imagetype fields values  
kernel\_imagetype=vmlinuz-5.3.0-51-generic  
initrd\_imagetype=initrd.img-5.3.0-51-generic

2. Unmount boot partition  
 cd sudo umount /mnt/boot

3. Burn Golden image (.img) on SD Card Format the SD card to type FAT32  
$ sudo dd if=\<.img file path\> of= bs=1M status=progress conv=fsync && sudo sync

4. Burn Host Machine with prepared SD Card with Golden Image  
a. Insert Ubuntu 18.04 bootable pen drive on Host Machine (machine on which mender image (.mender) will deploy) and boot up Host Machine with Pen drive and Try Ubuntu option.  
b. After booting up with Pen Drive and Try Ubuntu, Insert SD Card on Host Machine.

On reboot, i am getting an error as **`"login incorrect sulogin: crypt failed: Invalid argument"`**  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/36a4304f3846dd0e5a12fda708ced9d3f85b5852.jpeg)

![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/b323c0fe2fdab2c5373b83509031652166dd6ed8.jpeg)

I would gladly accept if you have an idea or want to give advice.  
Best regards

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [November 9, 2020, 6:24pm UTC](https://hub.mender.io/t/getting-error-on-flash-img-file-ubuntu-18-04-x86-generated-using-mender-convert-latest-tool/2781/2 "2020-11-09T18:24:45Z")

</div>

I don’t have any specific idea. It seems that something is not correct with your pam configuration or something.

Sorry I can’t be of more help.

Drew
