{"id":799,"date":"2021-12-23T14:05:17","date_gmt":"2021-12-23T13:05:17","guid":{"rendered":"https:\/\/www.gerjon.com\/?p=799"},"modified":"2021-12-23T19:26:10","modified_gmt":"2021-12-23T18:26:10","slug":"vmware-upgrading-esx-hosts-via-ssh-the-lazy-way","status":"publish","type":"post","link":"https:\/\/www.gerjon.com\/?p=799","title":{"rendered":"Upgrading ESX hosts via ssh the lazy way :-)"},"content":{"rendered":"\n<p>My VMware homelab, as does any environment, needs updates from time to time. And because I use Intel NUC&#8217;s that don&#8217;t have a keyboard\/mouse and monitor attached to them upgrading via USB stick is not the ideal way. So i started searching online on how to fix this and it is surprisingly simple :-). In the following walkthrough I&#8217;ll demonstrate how I made it work without leaving my desk :-). There are 2 options for this, via internet or by uploading the update to a data store. Both options are in this blog.<\/p>\n\n\n\n<p>First things first log on to your ESXi host via the website and shutdown all VM&#8217;s.<\/p>\n\n\n\n<p>After that put the host in maintenance mode and enable SSH.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"344\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28-1024x378.png?resize=932%2C344&#038;ssl=1\" alt=\"\" class=\"wp-image-896\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=1024%2C378&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=300%2C111&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=768%2C283&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=1536%2C567&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=2048%2C755&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?resize=527%2C194&amp;ssl=1 527w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?w=1864 1864w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-51-28.png?w=2796 2796w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/a><\/figure>\n\n\n\n<p>If Enable Secure Shell (SSH) is not working go over to manage and services and enable the ssh service<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"308\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49-1024x338.png?resize=932%2C308&#038;ssl=1\" alt=\"\" class=\"wp-image-898\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?resize=1024%2C338&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?resize=300%2C99&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?resize=768%2C253&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?resize=527%2C174&amp;ssl=1 527w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-19-49.png?w=1412&amp;ssl=1 1412w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/a><\/figure>\n\n\n\n<p>Once the host is in maintenance mode, connect to the IP-address of the host via SSH (via putty or terminal).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-57-07.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"258\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-57-07.png?resize=564%2C258&#038;ssl=1\" alt=\"\" class=\"wp-image-897\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-57-07.png?w=564&amp;ssl=1 564w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-57-07.png?resize=300%2C137&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_12-57-07.png?resize=527%2C241&amp;ssl=1 527w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/a><figcaption>In my case I&#8217;m using terminal on MacOS so the command is: <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>ssh root@ipadress<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>After login via SSH run this command to enable outbound http traffic from the host to the internet. This also means that your internal infrastructure must allow access to the internet from the ESX Host<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>esxcli network firewall ruleset set -e true -r httpClient<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>o view the current installed version and profile<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>esxcli software profile get<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This will give you a list of installed software en versions (mind this is a long list, the required information is on the top of the list)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-31-47-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"120\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-31-47-1.png?resize=560%2C120&#038;ssl=1\" alt=\"\" class=\"wp-image-900\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-31-47-1.png?w=560&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-31-47-1.png?resize=300%2C64&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-31-47-1.png?resize=527%2C113&amp;ssl=1 527w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/figure>\n\n\n\n<p>Next use this command to retrieve the available updates based on the ESXi version you have<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>esxcli software sources profile list -d https:\/\/hostupdate.vmware.com\/software\/VUM\/PRODUCTION\/main\/vmw-depot-index.xml | grep -i ESXi-7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-11-18-copy-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"604\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-11-18-copy-1.png?resize=705%2C604&#038;ssl=1\" alt=\"\" class=\"wp-image-902\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-11-18-copy-1.png?w=705&amp;ssl=1 705w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-11-18-copy-1.png?resize=300%2C257&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-11-18-copy-1.png?resize=350%2C300&amp;ssl=1 350w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/a><figcaption>In my case I&#8217;m using ESXi-7 standard so the highlighted version is the latest version that is available. So I&#8217;ll update to that version using this command where PACKAGE NAME is the name of the update package (in my case ESXi-7.0U2d-18538813-standard)<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>esxcli software profile update -p PACKAGE-NAME -d https:\/\/hostupdate.vmware.com\/software\/VUM\/PRODUCTION\/main\/vmw-depot-index.xml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This will run the upgrade.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"35\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-1.png?resize=704%2C35&#038;ssl=1\" alt=\"\" class=\"wp-image-903\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-1.png?w=704&amp;ssl=1 704w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-1.png?resize=300%2C15&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-1.png?resize=527%2C26&amp;ssl=1 527w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/a><\/figure>\n\n\n\n<p>After the upgrade you get a screen saying (hopefully \ud83d\ude09 the upgrade completed successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"211\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-2.png?resize=687%2C211&#038;ssl=1\" alt=\"\" class=\"wp-image-904\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-2.png?w=687&amp;ssl=1 687w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-2.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/image-2.png?resize=527%2C162&amp;ssl=1 527w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/a><figcaption>It will also say reboot required = true.<\/figcaption><\/figure>\n\n\n\n<p>To reboot the host, type reboot in the command line and hit enter.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>reboot<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>After reboot put the host in production mode by removing maintenance mode, and start the necessary VM&#8217;s.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"232\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23-1024x255.png?resize=932%2C232&#038;ssl=1\" alt=\"\" class=\"wp-image-905\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?resize=1024%2C255&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?resize=300%2C75&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?resize=768%2C191&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?resize=527%2C131&amp;ssl=1 527w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2021\/12\/2021-12-23_13-50-23.png?w=1426&amp;ssl=1 1426w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/a><\/figure>\n\n\n\n<p>If your host has no access to the internet repository&#8217;s you can follow these steps:<\/p>\n\n\n\n<p>Login to your free MyVmware.com account and download&nbsp;the latest patches <a rel=\"noreferrer noopener\" href=\"http:\/\/www.vmware.com\/patchmgr\/download.portal\" target=\"_blank\">http:\/\/www.vmware.com\/patchmgr\/download.portal<\/a>.<\/p>\n\n\n\n<p>upload these patches to a data store that the host can connect to. This upload can be done via the ESXi webportal.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>esxcli software vib update -d \/vmfs\/volumes\/&lt;your_datastore&gt;\/&lt;name_of_the_patch_you_uploaded.zip<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Hope this helps! <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My VMware homelab, as does any environment, needs updates from time to time. And because I use Intel NUC&#8217;s that don&#8217;t have a keyboard\/mouse and monitor attached to them upgrading via USB stick is not &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14],"tags":[],"class_list":["post-799","post","type-post","status-publish","format-standard","hentry","category-vmware"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p59CpB-cT","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=799"}],"version-history":[{"count":7,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions"}],"predecessor-version":[{"id":920,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions\/920"}],"wp:attachment":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}