VMware Cloud Community
Jwoods
Expert
Expert
Jump to solution

Kickstart configs

I've just started testing my ks.cfg and was kind of stumped when alot of my options used in 2.5.x didn't work with 3.0.x. It seems that VMware is pushing everything towards the GUI and their isn't much to do with the CLI after install.

So I was wondering what everyone else was placing in their %post section? Or if you are using an "after-install" cleanup script, what kinds of things you're doing with that?

After starting over, I basically have the firewall and time configs in the %post section as well as adding additional nameservers for starters.

Reply
0 Kudos
30 Replies
sbeaver
Leadership
Leadership
Jump to solution

Not sure about the special characters BUT you can change the root logon a slightly different way and not use the #

setSSHRoot()

{

echo "Allowing root to login via SSH..." >> /root/PostInstall/PostInstall.log

mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old

sed -e "s/PermitRootLogin no/PermitRootLogin yes/g" /etc/ssh/sshd_config.old > /etc/ssh/sshd_config

rm -f /etc/ssh/sshd_config.old

/etc/init.d/ sshd restart

echo "$scriptName - Set root to login via SSH" >> /root/PostInstall/PostInstall.log

}

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
jasonboche
Immortal
Immortal
Jump to solution

Thanks Steve, the new version of the Service Console memory bump worked. Would it be possible for you to incoporate the changes you made into your original script way up above so that it works properly? That is a very nice collection of scripts, handy for others to use.

I'll continue to work on the bashrc prompt update script. Maybe I can figure it out eventually. There are lots of resources on the net for sed

Jas

VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

I updated the post to reflect the change so it should work now

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
jasonboche
Immortal
Immortal
Jump to solution

In a different file, I need the only existing instance of this:

\u@\h \W

changed to this:

\u@\h \w

\^^^^ notice the only change is the case of the W to w

Got it!

#Modification to display full path in COS bash prompt:

#Jason Boche

mv /etc/bashrc /etc/bashrc.old

sed -e "s/
h
\W/
h
\w/g" /etc/bashrc.old > /etc/bashrc

VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
Reply
0 Kudos
jasonboche
Immortal
Immortal
Jump to solution

Thanks again Steve.

VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Hey what are you doing here with this path in the COS?

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
jasonboche
Immortal
Immortal
Jump to solution

Let's say you're on the COS and you cd /etc/vmware/firewall

The default prompt will show:

\[root@vader firewall]#

After the scripted change, the prompt will show the full path of the directory you're in which I prefer (I'm an old DOS guy):

\[root@vader /etc/vmware/firewall]#

VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Nice one!! Good to know!! Smiley Happy

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
Jwoods
Expert
Expert
Jump to solution

Nice addition!

Reply
0 Kudos
gogogo5
Hot Shot
Hot Shot
Jump to solution

hello

bit of a n00b question on your script. What does the # symbol do when you are piping to your PostInstall.log file i.e. the #>> instead of just >>

e.g.

echo "Setting Service Console memory to 512MB" #>> /root/PostInstall/PostInstall.log

Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

That comments the next steps out so the command would not pipe it to log file. If you remove the # it will pipe the output to the file listed

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos