[virtualization] Remove guest discovery service

Remove guest discovery service based on discussion with the netemul
team.
Previously it was used by netemul guest integration test which got
removed during the netemul CFv2 migration.
CFv2 guest discovery can be implemented as a local component directly in
netemul integration test once guest integration tests are restored.

Bug: 72386

Change-Id: Id30155796ab01dfadb48940190791c6d7867b446
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/679851
Reviewed-by: Bruno Dal Bo <brunodalbo@google.com>
Commit-Queue: Alexander Radchenko <alerad@google.com>
diff --git a/src/virtualization/lib/guest_interaction/BUILD.gn b/src/virtualization/lib/guest_interaction/BUILD.gn
index d99d0bc..73c6e75 100644
--- a/src/virtualization/lib/guest_interaction/BUILD.gn
+++ b/src/virtualization/lib/guest_interaction/BUILD.gn
@@ -11,7 +11,6 @@
 group("tests") {
   testonly = true
   deps = [
-    ":guest_discovery_service",
     ":guest_interaction_operation_tests",
     ":guest_interaction_tests",
   ]
@@ -19,10 +18,7 @@
 
 group("guest_interaction") {
   testonly = true
-  deps = [
-    ":debian_guest_interaction_daemon",
-    ":guest_discovery_service",
-  ]
+  deps = [ ":debian_guest_interaction_daemon" ]
 }
 
 proto_library("proto") {
@@ -166,26 +162,17 @@
   outputs = [ "data/{{source_file_part}}" ]
 }
 
-fuchsia_test_component("guest_interaction_service_test_cmp") {
+fuchsia_test_component("server_daemon_test_cmp") {
   deps = [
-    ":guest_interaction_service_test",
+    ":server_daemon_test",
     ":test_script",
   ]
-  component_name = "guest_interaction_service_test"
-  manifest = "meta/guest_interaction_service_test.cmx"
-}
-
-fuchsia_test_component("server_daemon_test_cmp") {
-  deps = [ ":server_daemon_test" ]
   component_name = "server_daemon_test"
   manifest = "meta/server_daemon_test.cmx"
 }
 
 fuchsia_test_package("guest_interaction_tests") {
-  test_components = [
-    ":guest_interaction_service_test_cmp",
-    ":server_daemon_test_cmp",
-  ]
+  test_components = [ ":server_daemon_test_cmp" ]
   test_specs = {
     environments = guest_envs
     log_settings = {
@@ -240,63 +227,6 @@
   public_deps = [ "//sdk/fidl/fuchsia.io" ]
 }
 
-executable("guest_discovery_service_bin") {
-  output_name = "guest_discovery_service"
-
-  sources = [
-    "client/client_impl.h",
-    "client/guest_discovery_service.cc",
-    "client/guest_discovery_service.h",
-    "client/guest_discovery_service_main.cc",
-    "client/guest_interaction_service.cc",
-    "client/guest_interaction_service.h",
-  ]
-
-  deps = [
-    ":client_lib",
-    ":common",
-    ":fuchsia.netemul.guest",
-    ":platform_interface_posix",
-    "//sdk/fidl/fuchsia.virtualization",
-    "//sdk/lib/fdio",
-    "//sdk/lib/fit-promise",
-    "//sdk/lib/sys/cpp",
-    "//sdk/lib/syslog/cpp",
-    "//src/lib/fxl",
-    "//src/virtualization/lib/grpc",
-    "//third_party/grpc:grpc++",
-    "//zircon/system/ulib/async:async-cpp",
-    "//zircon/system/ulib/async-default",
-    "//zircon/system/ulib/async-loop:async-loop-cpp",
-    "//zircon/system/ulib/async-loop:async-loop-default",
-  ]
-
-  # Enables thrd_create_with_name in <threads.h>.
-  configs += [ "//build/config:all_source" ]
-}
-
-fuchsia_package_with_single_component("guest_discovery_service") {
-  deps = [ ":guest_discovery_service_bin" ]
-  manifest = "meta/guest_discovery_service.cmx"
-}
-
-executable("guest_interaction_service_test") {
-  testonly = true
-
-  sources = [ "test/service_integration_test.cc" ]
-
-  deps = [
-    ":common",
-    ":fuchsia.netemul.guest",
-    ":integration_test_lib",
-    "//sdk/lib/fdio",
-    "//sdk/lib/sys/cpp",
-    "//sdk/lib/syslog/cpp",
-    "//src/lib/fxl/test:gtest_main",
-    "//src/lib/testing/predicates",
-  ]
-}
-
 extras_image = "$target_out_dir/linux/extras.img"
 
 romfs_image("extras") {
diff --git a/src/virtualization/lib/guest_interaction/client/guest_discovery_service.cc b/src/virtualization/lib/guest_interaction/client/guest_discovery_service.cc
deleted file mode 100644
index 92079ae..0000000
--- a/src/virtualization/lib/guest_interaction/client/guest_discovery_service.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/virtualization/lib/guest_interaction/client/guest_discovery_service.h"
-
-using ::fuchsia::virtualization::HostVsockEndpoint_Connect2_Result;
-
-GuestDiscoveryServiceImpl::GuestDiscoveryServiceImpl(async_dispatcher_t* dispatcher)
-    : context_(sys::ServiceDirectory::CreateFromNamespace(), dispatcher), executor_(dispatcher) {
-  context_.svc()->Connect(manager_.NewRequest(dispatcher));
-  manager_.set_error_handler([this](zx_status_t status) {
-    std::lock_guard lock(lock_);
-    for (auto& completer : manager_completers_) {
-      completer->complete_error(status);
-    }
-  });
-  context_.outgoing()->AddPublicService(bindings_.GetHandler(this, dispatcher));
-  context_.outgoing()->ServeFromStartupInfo(dispatcher);
-}
-
-namespace {
-// Helpers from the reference documentation for std::visit<>, to allow
-// visit-by-overload of std::variant<>.
-template <class... Ts>
-struct overloaded : Ts... {
-  using Ts::operator()...;
-};
-// explicit deduction guide (not needed as of C++20).
-template <class... Ts>
-overloaded(Ts...) -> overloaded<Ts...>;
-}  // namespace
-
-void GuestDiscoveryServiceImpl::GetGuest(
-    fidl::StringPtr realm_name, std::string guest_name,
-    fidl::InterfaceRequest<fuchsia::netemul::guest::GuestInteraction> request) {
-  // Find the realm ID and guest instance ID associated with the caller's labels.
-  fpromise::bridge<GuestInfo, zx_status_t> bridge;
-  std::shared_ptr completer =
-      std::make_shared<decltype(bridge.completer)>(std::move(bridge.completer));
-  {
-    std::lock_guard lock(lock_);
-    manager_completers_.insert(completer);
-  }
-  manager_->List([completer,
-                  realm_name = realm_name.value_or(fuchsia::netemul::guest::DEFAULT_REALM),
-                  guest_name = std::move(guest_name)](
-                     const std::vector<fuchsia::virtualization::EnvironmentInfo>& realm_infos) {
-    for (const auto& realm_info : realm_infos) {
-      if (realm_info.label == realm_name) {
-        for (const auto& instance_info : realm_info.instances) {
-          if (instance_info.label == guest_name) {
-            completer->complete_ok({
-                .realm_id = realm_info.id,
-                .guest_cid = instance_info.cid,
-            });
-            return;
-          }
-        }
-      }
-    }
-    completer->complete_error(ZX_ERR_NOT_FOUND);
-  });
-  fpromise::promise<> task =
-      bridge.consumer.promise()
-          .inspect([this, completer](const fpromise::result<GuestInfo, zx_status_t>&) {
-            std::lock_guard lock(lock_);
-            manager_completers_.erase(completer);
-          })
-          .and_then([this](const GuestInfo& guest_info)
-                        -> fpromise::promise<FuchsiaGuestInteractionService*, zx_status_t> {
-            auto [it, inserted] = guests_.try_emplace(guest_info);
-            std::variant<GuestCompleters, FuchsiaGuestInteractionService>& variant = it->second;
-            if (!inserted) {
-              // An entry already exists; the connection to the guest is either complete or in
-              // progress; if it is complete, return a resolved promise, otherwise store a completer
-              // to be resolved when the connection completes.
-              return std::visit(
-                  overloaded{
-                      [](FuchsiaGuestInteractionService& guest)
-                          -> fpromise::promise<FuchsiaGuestInteractionService*, zx_status_t> {
-                        return fpromise::make_result_promise<FuchsiaGuestInteractionService*,
-                                                             zx_status_t>(fpromise::ok(&guest));
-                      },
-                      [](GuestCompleters& completers)
-                          -> fpromise::promise<FuchsiaGuestInteractionService*, zx_status_t> {
-                        fpromise::bridge<FuchsiaGuestInteractionService*, zx_status_t> bridge;
-                        completers.push_back(std::move(bridge.completer));
-                        return bridge.consumer.promise();
-                      },
-                  },
-                  variant);
-            }
-
-            fuchsia::virtualization::RealmSyncPtr realm;
-            manager_->Connect(guest_info.realm_id, realm.NewRequest());
-
-            fpromise::bridge<FuchsiaGuestInteractionService*, zx_status_t> bridge;
-            std::shared_ptr completer =
-                std::make_shared<decltype(bridge.completer)>(std::move(bridge.completer));
-
-            fuchsia::virtualization::HostVsockEndpointPtr ep;
-            ep.set_error_handler(
-                [completer](zx_status_t status) { completer->complete_error(status); });
-            realm->GetHostVsockEndpoint(ep.NewRequest(executor_.dispatcher()));
-
-            auto completers_cb = [this, guest_info, &variant, completer](
-                                     GuestCompleters completers, zx::socket socket,
-                                     zx_status_t status) mutable {
-              if (status != ZX_OK) {
-                // Connecting to the guest failed; notify pending completers and remove the entry to
-                // allow retries.
-                completer->complete_error(status);
-                for (auto& pending : completers) {
-                  pending.complete_error(status);
-                }
-                guests_.erase(guest_info);
-              } else {
-                // Connecting to the guest succeeded; replace pending completers with the complete
-                // connection and notify them.
-                FuchsiaGuestInteractionService& guest =
-                    variant.emplace<FuchsiaGuestInteractionService>(std::move(socket),
-                                                                    executor_.dispatcher());
-                completer->complete_ok(&guest);
-                for (auto& pending : completers) {
-                  pending.complete_ok(&guest);
-                }
-              }
-            };
-
-            auto connect_cb = [completer, completers_cb = std::move(completers_cb),
-                               &variant](HostVsockEndpoint_Connect2_Result result) mutable {
-              std::visit(overloaded{
-                             [completer](FuchsiaGuestInteractionService& guest) {
-                               // We completed the connection to the guest and
-                               // discovered an already-existing connection. This should
-                               // never happen.
-                               FX_LOGS(ERROR) << "existing connection in connection callback";
-                               completer->complete_ok(&guest);
-                             },
-                             [&](GuestCompleters& completers) {
-                               if (result.is_response()) {
-                                 completers_cb(std::move(completers),
-                                               std::move(result.response().socket), ZX_OK);
-                               } else {
-                                 completers_cb(std::move(completers), zx::socket(), result.err());
-                               }
-                             },
-                         },
-                         variant);
-            };
-
-            ep->Connect2(GUEST_INTERACTION_PORT, std::move(connect_cb));
-
-            return bridge.consumer.promise().inspect(
-                [ep = std::move(ep)](
-                    const fpromise::result<FuchsiaGuestInteractionService*, zx_status_t>&) {});
-          })
-          .and_then(
-              [request = std::move(request)](FuchsiaGuestInteractionService*& service) mutable {
-                service->AddBinding(std::move(request));
-              })
-          .or_else([](const zx_status_t& status) {
-            FX_PLOGS(ERROR, status) << "Guest connection failed";
-          })
-          .wrap_with(scope_);
-  executor_.schedule_task(std::move(task));
-}
diff --git a/src/virtualization/lib/guest_interaction/client/guest_discovery_service.h b/src/virtualization/lib/guest_interaction/client/guest_discovery_service.h
deleted file mode 100644
index f904a7e..0000000
--- a/src/virtualization/lib/guest_interaction/client/guest_discovery_service.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_DISCOVERY_SERVICE_H_
-#define SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_DISCOVERY_SERVICE_H_
-
-#include <fuchsia/netemul/guest/cpp/fidl.h>
-#include <fuchsia/virtualization/cpp/fidl.h>
-#include <lib/async/cpp/executor.h>
-#include <lib/fidl/cpp/binding_set.h>
-#include <lib/fpromise/bridge.h>
-#include <lib/fpromise/scope.h>
-#include <lib/sys/cpp/component_context.h>
-
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-
-#include "src/lib/fxl/macros.h"
-#include "src/virtualization/lib/guest_interaction/client/guest_interaction_service.h"
-
-struct GuestInfo {
-  uint32_t realm_id;
-  uint32_t guest_cid;
-
-  bool operator==(const GuestInfo& rhs) const {
-    return (realm_id == rhs.realm_id) && (guest_cid == rhs.guest_cid);
-  }
-};
-
-template <>
-struct std::hash<GuestInfo> {
-  size_t operator()(GuestInfo const& guest_info) const noexcept {
-    size_t result = 0;
-    result = (result << 1) ^ std::hash<uint32_t>{}(guest_info.realm_id);
-    result = (result << 1) ^ std::hash<uint32_t>{}(guest_info.guest_cid);
-    return result;
-  }
-};
-
-class GuestDiscoveryServiceImpl final : public fuchsia::netemul::guest::GuestDiscovery {
- public:
-  explicit GuestDiscoveryServiceImpl(async_dispatcher_t*);
-  void GetGuest(fidl::StringPtr realm_name, std::string guest_name,
-                fidl::InterfaceRequest<fuchsia::netemul::guest::GuestInteraction>) override;
-
- private:
-  using GuestCompleters =
-      std::vector<fpromise::completer<FuchsiaGuestInteractionService*, zx_status_t>>;
-  std::unordered_map<GuestInfo, std::variant<GuestCompleters, FuchsiaGuestInteractionService>>
-      guests_;
-  sys::ComponentContext context_;
-  async::Executor executor_;
-  fpromise::scope scope_;
-  fuchsia::virtualization::ManagerPtr manager_;
-  std::mutex lock_;
-  std::unordered_set<std::shared_ptr<fpromise::completer<GuestInfo, zx_status_t>>>
-      manager_completers_ __TA_GUARDED(lock_);
-  fidl::BindingSet<fuchsia::netemul::guest::GuestDiscovery> bindings_;
-
-  FXL_DISALLOW_COPY_ASSIGN_AND_MOVE(GuestDiscoveryServiceImpl);
-};
-
-#endif  // SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_DISCOVERY_SERVICE_H_
diff --git a/src/virtualization/lib/guest_interaction/client/guest_discovery_service_main.cc b/src/virtualization/lib/guest_interaction/client/guest_discovery_service_main.cc
deleted file mode 100644
index 231b0b7..0000000
--- a/src/virtualization/lib/guest_interaction/client/guest_discovery_service_main.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <lib/async-loop/cpp/loop.h>
-#include <lib/async-loop/default.h>
-
-#include "src/virtualization/lib/guest_interaction/client/guest_discovery_service.h"
-
-int main(int argc, char** argv) {
-  async::Loop loop(&kAsyncLoopConfigNoAttachToCurrentThread);
-
-  // Create the guest interaction service and run its gRPC processing loop on
-  // a separate thread.
-  GuestDiscoveryServiceImpl guest_discovery_service = GuestDiscoveryServiceImpl(loop.dispatcher());
-
-  return loop.Run();
-}
diff --git a/src/virtualization/lib/guest_interaction/client/guest_interaction_service.cc b/src/virtualization/lib/guest_interaction/client/guest_interaction_service.cc
deleted file mode 100644
index 8a39407..0000000
--- a/src/virtualization/lib/guest_interaction/client/guest_interaction_service.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/virtualization/lib/guest_interaction/client/guest_interaction_service.h"
-
-#include <lib/async/cpp/task.h>
-
-#include "src/virtualization/lib/grpc/fdio_util.h"
-#include "src/virtualization/lib/guest_interaction/common.h"
-
-FuchsiaGuestInteractionService::FuchsiaGuestInteractionService(zx::socket socket,
-                                                               async_dispatcher_t* dispatcher)
-    : client_([&socket]() {
-        fbl::unique_fd fd;
-        zx_status_t status = fdio_fd_create(socket.release(), fd.reset_and_get_address());
-        if (status != ZX_OK) {
-          FX_PLOGS(FATAL, status) << "fdio_fd_create";
-        }
-        int err = SetNonBlocking(fd);
-        if (err != 0) {
-          FX_LOGS(FATAL) << "SetNonBlocking: " << strerror(err);
-        }
-        return fd.release();
-      }()),
-      dispatcher_(dispatcher) {
-  int ret = client_.Start(guest_interaction_service_thread_);
-  ZX_ASSERT_MSG(ret == thrd_success, "thread creation failed: %d", ret);
-}
-
-FuchsiaGuestInteractionService::~FuchsiaGuestInteractionService() {
-  client_.Stop();
-  int32_t ret_code;
-  int ret = thrd_join(guest_interaction_service_thread_, &ret_code);
-  ZX_ASSERT_MSG(ret == thrd_success, "thread joining failed: %d", ret);
-  ZX_ASSERT_MSG(ret_code == 0, "thread exited non-zero: %d", ret_code);
-}
-
-void FuchsiaGuestInteractionService::PutFile(fidl::InterfaceHandle<fuchsia::io::File> local_file,
-                                             std::string remote_path,
-                                             fit::function<void(zx_status_t)> callback) {
-  client_.Put(
-      std::move(local_file), remote_path,
-      [dispatcher = dispatcher_, callback = std::move(callback)](zx_status_t status) mutable {
-        async::PostTask(dispatcher,
-                        [callback = std::move(callback), status]() { callback(status); });
-      });
-}
-
-void FuchsiaGuestInteractionService::GetFile(std::string remote_path,
-                                             fidl::InterfaceHandle<fuchsia::io::File> local_file,
-                                             fit::function<void(zx_status_t)> callback) {
-  client_.Get(
-      remote_path, std::move(local_file),
-      [dispatcher = dispatcher_, callback = std::move(callback)](zx_status_t status) mutable {
-        async::PostTask(dispatcher,
-                        [callback = std::move(callback), status]() { callback(status); });
-      });
-}
-
-void FuchsiaGuestInteractionService::ExecuteCommand(
-    std::string command, std::vector<fuchsia::netemul::guest::EnvironmentVariable> env,
-    zx::socket std_in, zx::socket std_out, zx::socket std_err,
-    fidl::InterfaceRequest<fuchsia::netemul::guest::CommandListener> req) {
-  std::map<std::string, std::string> env_map;
-  for (const auto& env_var : env) {
-    env_map[env_var.key] = env_var.value;
-  }
-
-  client_.Exec(command, env_map, std::move(std_in), std::move(std_out), std::move(std_err),
-               std::move(req), dispatcher_);
-}
-
-void FuchsiaGuestInteractionService::AddBinding(
-    fidl::InterfaceRequest<fuchsia::netemul::guest::GuestInteraction> request) {
-  bindings_.AddBinding(this, std::move(request), dispatcher_);
-}
diff --git a/src/virtualization/lib/guest_interaction/client/guest_interaction_service.h b/src/virtualization/lib/guest_interaction/client/guest_interaction_service.h
deleted file mode 100644
index 234951e..0000000
--- a/src/virtualization/lib/guest_interaction/client/guest_interaction_service.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_INTERACTION_SERVICE_H_
-#define SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_INTERACTION_SERVICE_H_
-
-#include <fuchsia/netemul/guest/cpp/fidl.h>
-#include <lib/fidl/cpp/binding_set.h>
-#include <lib/fit/function.h>
-#include <threads.h>
-
-#include "src/lib/fxl/macros.h"
-#include "src/virtualization/lib/guest_interaction/client/client_impl.h"
-#include "src/virtualization/lib/guest_interaction/platform_interface/platform_interface.h"
-
-class FuchsiaGuestInteractionService final : public fuchsia::netemul::guest::GuestInteraction {
- public:
-  FuchsiaGuestInteractionService(zx::socket socket, async_dispatcher_t* dispatcher);
-  ~FuchsiaGuestInteractionService() override;
-  void PutFile(fidl::InterfaceHandle<fuchsia::io::File> local_file, std::string remote_path,
-               fit::function<void(zx_status_t)> callback) override;
-  void GetFile(std::string remote_path, fidl::InterfaceHandle<fuchsia::io::File> local_file,
-               fit::function<void(zx_status_t)> callback) override;
-  void ExecuteCommand(
-      std::string command, std::vector<fuchsia::netemul::guest::EnvironmentVariable> env,
-      zx::socket std_in, zx::socket std_out, zx::socket std_err,
-      fidl::InterfaceRequest<fuchsia::netemul::guest::CommandListener> req) override;
-  void AddBinding(fidl::InterfaceRequest<fuchsia::netemul::guest::GuestInteraction> request);
-
- private:
-  ClientImpl<PosixPlatform> client_;
-  async_dispatcher_t* dispatcher_;
-  fidl::BindingSet<fuchsia::netemul::guest::GuestInteraction> bindings_;
-  thrd_t guest_interaction_service_thread_;
-
-  FXL_DISALLOW_COPY_ASSIGN_AND_MOVE(FuchsiaGuestInteractionService);
-};
-
-#endif  // SRC_VIRTUALIZATION_LIB_GUEST_INTERACTION_CLIENT_GUEST_INTERACTION_SERVICE_H_
diff --git a/src/virtualization/lib/guest_interaction/meta/guest_discovery_service.cmx b/src/virtualization/lib/guest_interaction/meta/guest_discovery_service.cmx
deleted file mode 100644
index 68d10f2..0000000
--- a/src/virtualization/lib/guest_interaction/meta/guest_discovery_service.cmx
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "include": [
-        "syslog/client.shard.cmx"
-    ],
-    "program": {
-        "binary": "bin/guest_discovery_service"
-    },
-    "sandbox": {
-        "services": [
-            "fuchsia.netemul.network.Endpoint",
-            "fuchsia.virtualization.Manager",
-            "fuchsia.virtualization.Realm"
-        ]
-    }
-}
diff --git a/src/virtualization/lib/guest_interaction/meta/guest_interaction_service_test.cmx b/src/virtualization/lib/guest_interaction/meta/guest_interaction_service_test.cmx
deleted file mode 100644
index 59f070a..0000000
--- a/src/virtualization/lib/guest_interaction/meta/guest_interaction_service_test.cmx
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-    "facets": {
-        "fuchsia.test": {
-            "system-services": [
-                "fuchsia.kernel.HypervisorResource",
-                "fuchsia.kernel.VmexResource",
-                "fuchsia.sysinfo.SysInfo"
-            ]
-        }
-    },
-    "include": [
-        "syslog/client.shard.cmx"
-    ],
-    "program": {
-        "binary": "bin/guest_interaction_service_test"
-    },
-    "sandbox": {
-        "features": [
-            "isolated-temp"
-        ],
-        "services": [
-            "fuchsia.kernel.HypervisorResource",
-            "fuchsia.kernel.VmexResource",
-            "fuchsia.sys.Environment",
-            "fuchsia.sys.Loader",
-            "fuchsia.sysinfo.SysInfo"
-        ]
-    }
-}
diff --git a/src/virtualization/lib/guest_interaction/test/integration_test_lib.h b/src/virtualization/lib/guest_interaction/test/integration_test_lib.h
index f754bc5..7b6a8bf 100644
--- a/src/virtualization/lib/guest_interaction/test/integration_test_lib.h
+++ b/src/virtualization/lib/guest_interaction/test/integration_test_lib.h
@@ -11,8 +11,6 @@
 #include <src/virtualization/tests/fake_netstack.h>
 
 static constexpr char kGuestLabel[] = "debian_guest";
-static constexpr char kGuestDiscoveryUrl[] =
-    "fuchsia-pkg://fuchsia.com/guest_discovery_service#meta/guest_discovery_service.cmx";
 
 // The host will copy kTestScriptSource to kGuestScriptDestination on the
 // guest.  The host will then ask the guest to exec kGuestScriptDestination
diff --git a/src/virtualization/lib/guest_interaction/test/service_integration_test.cc b/src/virtualization/lib/guest_interaction/test/service_integration_test.cc
deleted file mode 100644
index 30adae6..0000000
--- a/src/virtualization/lib/guest_interaction/test/service_integration_test.cc
+++ /dev/null
@@ -1,268 +0,0 @@
-// Copyright 2019 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <fcntl.h>
-#include <fuchsia/netemul/guest/cpp/fidl.h>
-#include <lib/fdio/directory.h>
-#include <lib/fdio/fd.h>
-#include <lib/sys/cpp/file_descriptor.h>
-#include <lib/syslog/cpp/macros.h>
-#include <unistd.h>
-
-#include <fbl/unique_fd.h>
-#include <gtest/gtest.h>
-
-#include "src/lib/testing/predicates/status.h"
-#include "src/virtualization/lib/guest_interaction/common.h"
-#include "src/virtualization/lib/guest_interaction/test/integration_test_lib.h"
-
-class GuestInteractionTestWithDiscovery : public GuestInteractionTest {
- protected:
-  GuestInteractionTestWithDiscovery() {
-    services().AddServiceWithLaunchInfo(
-        {
-            .url = kGuestDiscoveryUrl,
-            .out = sys::CloneFileDescriptor(STDOUT_FILENO),
-            .err = sys::CloneFileDescriptor(STDERR_FILENO),
-
-        },
-        fuchsia::netemul::guest::GuestDiscovery::Name_);
-  }
-
-  fuchsia::netemul::guest::GuestInteractionPtr guest_interaction() {
-    if (!guest_discovery_.is_bound()) {
-      env().ConnectToService(guest_discovery_.NewRequest());
-    }
-    fuchsia::netemul::guest::GuestInteractionPtr guest_interaction;
-    guest_discovery_->GetGuest(std::nullopt, kGuestLabel, guest_interaction.NewRequest());
-    return guest_interaction;
-  }
-
- private:
-  fuchsia::netemul::guest::GuestDiscoveryPtr guest_discovery_;
-};
-
-// Call into the guest interaction fidl service to push a test bash script, run
-// the bash script, and pull back the results generated by the script.  The
-// script emits output to stdout and stderr and accepts input from stdin which
-// is used to generate the output file.
-TEST_F(GuestInteractionTestWithDiscovery, FidlExecScriptTest) {
-  fuchsia::netemul::guest::GuestInteractionPtr gis = guest_interaction();
-  std::optional<zx_status_t> gis_status;
-  gis.set_error_handler([&gis_status](zx_status_t status) { gis_status = status; });
-
-  // Push the bash script to the guest
-  FX_LOGS(INFO) << "Sending script to guest";
-  fidl::InterfaceHandle<fuchsia::io::File> put_file;
-  ASSERT_OK(fdio_open(kTestScriptSource,
-                      static_cast<uint32_t>(fuchsia::io::OpenFlags::RIGHT_READABLE),
-                      put_file.NewRequest().TakeChannel().release()));
-
-  std::optional<zx_status_t> put_status;
-  gis->PutFile(std::move(put_file), kGuestScriptDestination,
-               [&put_status](zx_status_t status) { put_status = status; });
-  RunLoopUntil(
-      [&gis_status, &put_status]() { return gis_status.has_value() || put_status.has_value(); });
-  ASSERT_FALSE(gis_status.has_value()) << zx_status_get_string(gis_status.value());
-  ASSERT_TRUE(put_status.has_value());
-  ASSERT_OK(put_status.value());
-
-  // Run the bash script in the guest.  The script will write to stdout and
-  // stderr.  The script will also block waiting to receive input from stdin.
-  zx::socket stdin_writer, stdin_reader;
-  ASSERT_OK(zx::socket::create(0, &stdin_writer, &stdin_reader));
-
-  zx::socket stdout_writer, stdout_reader;
-  ASSERT_OK(zx::socket::create(0, &stdout_writer, &stdout_reader));
-
-  zx::socket stderr_writer, stderr_reader;
-  ASSERT_OK(zx::socket::create(0, &stderr_writer, &stderr_reader));
-
-  // Run the bash script on the guest.
-  FX_LOGS(INFO) << "Running script in guest";
-  std::string command = std::string("/bin/sh ");
-  command.append(kGuestScriptDestination);
-  std::vector<fuchsia::netemul::guest::EnvironmentVariable> env_vars = {
-      {"STDOUT_STRING", kTestStdout}, {"STDERR_STRING", kTestStderr}};
-  std::string std_out;
-  std::string std_err;
-  std::optional<zx_status_t> exec_started;
-  std::optional<zx_status_t> exec_terminated;
-
-  fuchsia::netemul::guest::CommandListenerPtr listener;
-  listener.events().OnStarted = [&](zx_status_t status) {
-    // Once the subprocess has started, write to stdin.
-    std::string to_write = std::string(::kTestScriptInput);
-    uint32_t bytes_written = 0;
-
-    while (bytes_written < to_write.size()) {
-      size_t curr_bytes_written;
-      zx_status_t write_status =
-          stdin_writer.write(0, &(to_write.c_str()[bytes_written]), to_write.size() - bytes_written,
-                             &curr_bytes_written);
-      if (write_status != ZX_OK) {
-        return;
-      }
-
-      bytes_written += curr_bytes_written;
-    }
-    stdin_writer.reset();
-    exec_started = status;
-  };
-  listener.events().OnTerminated = [&](zx_status_t status, int32_t exit_code) {
-    // When the process terminates, read from stdout and stderr.
-    exec_terminated = status;
-
-    size_t bytes_read = 0;
-    char read_buf[100];
-    while (true) {
-      zx_status_t read_status = stdout_reader.read(0, read_buf, 100, &bytes_read);
-      if (read_status != ZX_OK) {
-        break;
-      }
-      std_out += std::string(read_buf, bytes_read);
-    }
-    while (true) {
-      zx_status_t read_status = stderr_reader.read(0, read_buf, 100, &bytes_read);
-      if (read_status != ZX_OK) {
-        break;
-      }
-      std_err += std::string(read_buf, bytes_read);
-    }
-  };
-
-  gis->ExecuteCommand(command, env_vars, std::move(stdin_reader), std::move(stdout_writer),
-                      std::move(stderr_writer), listener.NewRequest());
-
-  // Wait for the subprocess to start.
-  RunLoopUntil([&gis_status, &exec_started]() {
-    return gis_status.has_value() || exec_started.has_value();
-  });
-  ASSERT_FALSE(gis_status.has_value()) << zx_status_get_string(gis_status.value());
-  ASSERT_TRUE(exec_started.has_value());
-  ASSERT_OK(exec_started.value());
-
-  // Wait for the bash script to finish.
-  RunLoopUntil([&gis_status, &exec_terminated]() {
-    return gis_status.has_value() || exec_terminated.has_value();
-  });
-  ASSERT_FALSE(gis_status.has_value()) << zx_status_get_string(gis_status.value());
-  ASSERT_TRUE(exec_terminated.has_value());
-  ASSERT_OK(exec_terminated.value());
-
-  // Validate the stdout and stderr.
-  ASSERT_EQ(std_out, (std::string(kTestStdout) + std::string("\n")));
-  ASSERT_EQ(std_err, (std::string(kTestStderr) + std::string("\n")));
-
-  // The bash script will create a file with contents that were written to
-  // stdin.  Pull this file back and inspect its contents.
-  fidl::InterfaceHandle<fuchsia::io::File> get_file;
-  ASSERT_OK(fdio_open(
-      kHostOuputCopyLocation,
-      static_cast<uint32_t>(fuchsia::io::OpenFlags::RIGHT_WRITABLE |
-                            fuchsia::io::OpenFlags::CREATE | fuchsia::io::OpenFlags::TRUNCATE),
-      get_file.NewRequest().TakeChannel().release()));
-
-  std::optional<zx_status_t> get_status;
-  gis->GetFile(kGuestFileOutputLocation, std::move(get_file),
-               [&get_status](zx_status_t status) { get_status = status; });
-  RunLoopUntil(
-      [&gis_status, &get_status]() { return gis_status.has_value() || get_status.has_value(); });
-  ASSERT_FALSE(gis_status.has_value()) << zx_status_get_string(gis_status.value());
-  ASSERT_TRUE(get_status.has_value());
-  ASSERT_OK(get_status.value());
-
-  // Verify the contents that were communicated through stdin.
-  std::string output_string;
-  {
-    fbl::unique_fd fd;
-    ASSERT_TRUE(fd = fbl::unique_fd(open(kHostOuputCopyLocation, O_RDONLY))) << strerror(errno);
-
-    char output_buf[100];
-    while (true) {
-      ssize_t read_size = read(fd.get(), output_buf, sizeof(output_buf));
-      ASSERT_GE(read_size, 0) << strerror(errno);
-      if (read_size == 0) {
-        break;
-      }
-      output_string.append(std::string(output_buf, read_size));
-    }
-  }
-
-  ASSERT_EQ(output_string, std::string(kTestScriptInput));
-}
-
-TEST_F(GuestInteractionTestWithDiscovery, FidlPutGetTest) {
-  fuchsia::netemul::guest::GuestInteractionPtr gis = guest_interaction();
-
-  // Write a file of gibberish that the test can send over to the guest.
-  constexpr char test_file[] = "/tmp/test_file.txt";
-  constexpr char guest_destination[] = "/root/new/directory/test_file.txt";
-  constexpr char host_verification_file[] = "/tmp/verification_file.txt";
-
-  std::string file_contents;
-  for (int i = 0; i < 2 * CHUNK_SIZE; i++) {
-    file_contents.push_back(static_cast<char>(i % (('z' - 'A') + 'A')));
-  }
-  {
-    fbl::unique_fd fd;
-    ASSERT_TRUE(fd = fbl::unique_fd(open(test_file, O_WRONLY | O_TRUNC | O_CREAT)))
-        << strerror(errno);
-    uint32_t bytes_written = 0;
-    while (bytes_written < file_contents.size()) {
-      ssize_t write_size = write(fd.get(), file_contents.c_str() + bytes_written,
-                                 file_contents.size() - bytes_written);
-      ASSERT_GT(write_size, 0);
-      bytes_written += write_size;
-    }
-  }
-
-  // Push the file to the guest
-  fidl::InterfaceHandle<fuchsia::io::File> put_file;
-  ASSERT_OK(fdio_open(test_file, static_cast<uint32_t>(fuchsia::io::OpenFlags::RIGHT_READABLE),
-                      put_file.NewRequest().TakeChannel().release()));
-
-  std::optional<zx_status_t> status;
-  gis.set_error_handler([&status](zx_status_t error_status) { status = error_status; });
-  gis->PutFile(std::move(put_file), guest_destination,
-               [&status](zx_status_t put_result) { status = put_result; });
-  RunLoopUntil([&status]() { return status.has_value(); });
-  ASSERT_TRUE(status.has_value());
-  ASSERT_OK(status.value());
-
-  // Pull back the guest's copy of the file and ensure the contents match those
-  // from the file generated above.
-  fidl::InterfaceHandle<fuchsia::io::File> get_file;
-  ASSERT_OK(fdio_open(
-      host_verification_file,
-      static_cast<uint32_t>(fuchsia::io::OpenFlags::RIGHT_WRITABLE |
-                            fuchsia::io::OpenFlags::CREATE | fuchsia::io::OpenFlags::TRUNCATE),
-      get_file.NewRequest().TakeChannel().release()));
-
-  status.reset();
-  gis->GetFile(guest_destination, std::move(get_file),
-               [&status](zx_status_t get_result) { status = get_result; });
-  RunLoopUntil([&status]() { return status.has_value(); });
-  ASSERT_TRUE(status.has_value());
-  ASSERT_OK(status.value());
-
-  // Verify the contents that were communicated through stdin.
-  std::string output_string;
-  {
-    fbl::unique_fd fd;
-    ASSERT_TRUE(fd = fbl::unique_fd(open(host_verification_file, O_RDONLY))) << strerror(errno);
-
-    char output_buf[100];
-    while (true) {
-      ssize_t read_size = read(fd.get(), output_buf, sizeof(output_buf));
-      ASSERT_GE(read_size, 0) << strerror(errno);
-      if (read_size == 0) {
-        break;
-      }
-      output_string.append(std::string(output_buf, read_size));
-    }
-  }
-
-  ASSERT_EQ(output_string, file_contents);
-}