diff --git a/misc/sample_application/image_builder/create_image.sh b/misc/sample_application/image_builder/create_image.sh index 73037ea45..87d146eea 100755 --- a/misc/sample_application/image_builder/create_image.sh +++ b/misc/sample_application/image_builder/create_image.sh @@ -147,7 +147,8 @@ personality=linux preserve-environment=true EOF - sudo sed -i -e '3,9 s/^/#/' /etc/schroot/default/nssdatabases && \ + sudo sed -ie "/passwd/d;/shadow/d;/group/d;/gshadow/d" \ + /etc/schroot/desktop/nssdatabases && \ sudo mv ${temp_file} /etc/schroot/chroot.d/acrn-guest && \ sudo chown root:root /etc/schroot/chroot.d/acrn-guest } diff --git a/misc/sample_application/image_builder/setup_hmi_vm.sh b/misc/sample_application/image_builder/setup_hmi_vm.sh index 4d78fd091..c0c8defff 100644 --- a/misc/sample_application/image_builder/setup_hmi_vm.sh +++ b/misc/sample_application/image_builder/setup_hmi_vm.sh @@ -41,7 +41,6 @@ function add_normal_user() { function enable_services() { services=(ssh.service isc-dhcp-server) - sudo ssh-keygen -A for service in ${services[*]} do systemctl enable ${service} @@ -49,6 +48,14 @@ function enable_services() { done } +function config_ssh() { + + sudo sed -ie 's/PasswordAuthentication no/PasswordAuthentication yes/g' \ + /etc/ssh/sshd_config + sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key + sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key +} + # Change current working directory to the root to avoid "target is busy" errors # on unmounting. cd / @@ -60,3 +67,4 @@ try_step "Installing GNOME desktop" install_desktop try_step "Changing the password of the root user" change_root_password try_step "Enable root user login" enable_root_login try_step "Adding the normal user acrn" add_normal_user +try_step "Configure the ssh service" config_ssh diff --git a/misc/sample_application/uservm/histapp.py b/misc/sample_application/uservm/histapp.py index 61f853d0e..06d434084 100644 --- a/misc/sample_application/uservm/histapp.py +++ b/misc/sample_application/uservm/histapp.py @@ -26,7 +26,7 @@ def histapp(): create_hist() #Send the histogram as a webpage to the user - return send_file("hist.png", mimetype='image/png') + return send_file("/root/hist.png", mimetype='image/png') #Creates the user histogram and saves to hist.png def create_hist(): @@ -52,7 +52,7 @@ def create_hist(): plt.title("ACRN Sample Application cyclictest display (unoptimized)") plt.xlabel("Latency Value (microseconds)") plt.ylabel("Count Percentage " + f"{count:,}") - plt.savefig("hist.png") + plt.savefig("/root/hist.png") return figure