# How to create Debian VM on VMWare using preseed config file

**URL:** <https://forum.ansible.com/t/how-to-create-debian-vm-on-vmware-using-preseed-config-file/11265>\
**Category:** Get Help\
**Tags:** vmware\
**Created:** [December 2, 2024, 2:53pm UTC](https://forum.ansible.com/t/how-to-create-debian-vm-on-vmware-using-preseed-config-file/11265 "2024-12-02T14:53:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Studer](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/olivier_studer/32/5310_2.png) [@Olivier\_Studer](https://forum.ansible.com/u/Olivier_Studer)\
**Post date:** [December 2, 2024, 2:53pm UTC](https://forum.ansible.com/t/how-to-create-debian-vm-on-vmware-using-preseed-config-file/11265/1 "2024-12-02T14:53:29Z")

</div>

Hi all,

I want to automate the installation of Debian VM on my VMWare infrastructure with using Ansible.

I would like know how can create the playbook to start the installation from the ISO file with giving the preseed config file to have auto-answer during the installation.

Steps:

1. Create the VM with community.vmware.vmware\_guest : DONE  
with add the Debian ISO file
2. I’ma able to power on the VM to start with the ISO file

But I’m not able to give the path of the preseed.cfg file and start the installation.

I need help,  
Thanks  
Olivier

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [December 3, 2024, 1:40am UTC](https://forum.ansible.com/t/how-to-create-debian-vm-on-vmware-using-preseed-config-file/11265/2 "2024-12-03T01:40:25Z")

</div>

Hi @Olivier_Studer,

You can try by using `vmware_guest_sendkey` module to send keyboard input to boot loader menu, edit boot menu entry to add path to preseed.cfg (served on some HTTP/FTP server) and then boot the machine. I have personally not tested this but it should be achievable. There is a catch though, you cannot send an arbitrary combination of special keys and characters. You have to call the module multiple times, first by sending some special keys, then some characters, then some special keys and so on. Please consult the documentation for details:

[https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware\_guest\_sendkey\_module.html](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_sendkey_module.html)

The other, more robust solution is to use PXE boot. I have outlined the basic idea here:

> [@Install an Operating system via pxe boot and ansible](http://forum.ansible.com/t/install-an-operating-system-via-pxe-boot-and-ansible/7309/5):
>
> It almost makes all the difference. VMs can be controlled with Ansible by using VM platform specific modules like vmware\_guest\*, xenserver\_guest\*, ovirt\_vm\*, or cloud specific like ec2\*, openstack.cloud.server\* etc. With physical machines you need some kind of out of band management capability like iLO (HP), iDRAC (Dell) and similar. Last time I experimented with this, Ansible modules for controlling life cycle of physical machines were not mature enough for my requirements. Maybe you will ha…
