Allow the vnc server to run when using crosvm as vmm
The vnc server sends input through unix sockets to crosvm's virtio
input devices and receives screen updates through a vsock socket.
Performance is not the best, but it's usable.
Bug: 128852363
Bug: 127361363
Test: run locally
Change-Id: I2b2be2c3f338e7624e390879293ce61186dded38
diff --git a/host/commands/launch/flags.cc b/host/commands/launch/flags.cc
index 6266b07..3f62a50 100644
--- a/host/commands/launch/flags.cc
+++ b/host/commands/launch/flags.cc
@@ -186,6 +186,8 @@
"guest to host. One of [serial, vsock]");
DEFINE_int32(logcat_vsock_port, vsoc::GetPerInstanceDefault(5620),
"The port for logcat over vsock");
+DEFINE_int32(frames_vsock_port, vsoc::GetPerInstanceDefault(5580),
+ "The vsock port to receive frames from the guest on");
namespace {
template<typename S, typename T>
@@ -420,6 +422,11 @@
tmp_config_obj.set_logcat_mode(FLAGS_logcat_mode);
tmp_config_obj.set_logcat_vsock_port(FLAGS_logcat_vsock_port);
+ tmp_config_obj.set_frames_vsock_port(FLAGS_frames_vsock_port);
+ if (!tmp_config_obj.enable_ivserver()) {
+ tmp_config_obj.add_kernel_cmdline(concat("androidboot.vsock_frames_port=",
+ FLAGS_frames_vsock_port));
+ }
tmp_config_obj.set_cuttlefish_env_path(GetCuttlefishEnvPath());
@@ -494,8 +501,6 @@
google::FlagSettingMode::SET_FLAGS_DEFAULT);
SetCommandLineOptionWithMode("run_e2e_test", "false",
google::FlagSettingMode::SET_FLAGS_DEFAULT);
- SetCommandLineOptionWithMode("start_vnc_server", "false",
- google::FlagSettingMode::SET_FLAGS_DEFAULT);
SetCommandLineOptionWithMode("logcat_mode", cvd::kLogcatVsockMode,
google::FlagSettingMode::SET_FLAGS_DEFAULT);
}