Sunday, September 16, 2018

Recover Crashed Ubuntu VM On Proxmox VE

One of our VM server accidentally crash and the partition table was deleted. It is using Ubuntu 14.04 on VMDK container. Here are what we did to recover the server.

Prerequisite: Ubuntu NON-EFI, ext4 partition

Convert vmdk to qico2
# qemu-img convert -f vmdk -O qcowq file.vmdk file.qcow2

Download ISO System Rescue CD from then treat as CD-ROM in the crashed VM, and then in the VM Console interface, boot from CD-ROM.

Run Test-disk

  1. Select the disk
  2. Select partition format: INTEL
  3. Analyze
  4. Deep search
  5. Select the righ partition
  6. Write
  7. Quit & reboot

Reload Using Ubuntu live CD
- fdisk recover extender partition (change type) from f to 5
- write, reboot

Install boot on /dev/sda, then reboot.

All done.

Mount to see files:
# qemu-nbd -c /dev/nbd0 file.qcow2
# partprobe /dev/nbd0
# mount /dev/nbd0 /mnt/nbd0

Friday, August 31, 2018

Avast Business Installer Installation Failed: Unable to Load Policy

Our team just installed Management console for Avast Business Antivirus, Avast Business Antivirus Pro and Avast Business Antivirus Pro Plus On local server (on-premise) on Windows 2008 Server R2. The server got IP Public, so all PC outside the office can install the Avast Business Installer generated from the console.

Unfortunately, we got error 'Installation Failed: Unable to Load Policy' during setup process.

After discuss with support from Avast reseller in Indonesia, we also discuss with support directly from Avast. They said there are a few things we can try to correct it. 
  1. Was there any Avast products on the server before? If yes, please remove using Avast clear to make sure everything is removed. Download from
  2. Make sure to remove all Anti-Virus programs before installation.
  3. Disable any local firewalls that may be preventing the program from running.
  4. Please make sure to download a new copy once you have made sure the other items are correct. 
  5. Login to portal (note: we use another address because our console installed in our own portal) and navigate to Add New Device > Customize > Choose options > Download.

Avast support suggest doing the full installer. Also, after downloading and before installing "right click" on the file and select "Properties". Sometimes there will be a Security option at the bottom, make sure to unblock the program as shown in the screenshot below. 

The client/cloud server communication is completed using the following ports. To ensure proper communication to the cloud portal please make sure all ports below are open and also the whitelisting of *

- http/80 (updates) 
- https/443 (FFL encryption key negotiation) 
- TCP, UDP/ 443, 53 for secure DNS 
- *
- Update servers

After I tried the solutions, they dont work!

Then I tried to check all ports used to communicate between client and server, and got that Avast use 8080/8090 for server/client stuff. After out network admin open the port, then the installation work seamlessly.

Wednesday, September 13, 2017

How to Replace and Rewrite Sender Address in Postfix

I am setting up Postfix on a Linux server because I want to send mail independently. I need to change sender address because the default sender is from user@server.local.

This config changes sender addresses from both local originated, and relayed SMTP mail traffic:
# nano /etc/postfix/
sender_canonical_classes = envelope_sender, header_sender
sender_canonical_maps =  regexp:/etc/postfix/sender_canonical_maps
smtp_header_checks = regexp:/etc/postfix/header_check
Rewrite envelope address from email originating from the server
# nano /etc/postfix/sender_canonical_maps:
Rewrite from address in SMTP relayed e-mail
# nano /etc/postfix/header_check:
/From:.*/ REPLACE From: